未初始化的字符串偏移量:0

时间:2015-04-02 08:53:50

标签: php login laravel-5

我收到了以下错误:ClassLoader.php第317行中的ErrorException:

  

未初始化的字符串偏移量:0。

class AccountController extends Controller {

    public function getSignIn(){
        return View::make('account.signin');
    }

    public function postSignIn(){

        // validate the info, create rules for the inputs
        $rules = 
            [
                'email'    => 'required|email', // make sure the email is an actual email
                'password' => 'required|alphaNum|min:6' // password can only be alphanumeric and has to be greater than 3 characters
            ];

        $validator = Validator::make(Input::all(), $rules);

        if ($validator->fails()) {
            return Redirect::route('account-sign-in')
                ->withErrors($validator)
                ->withInput();
        }
         else{
            $auth = 
                [
                    'email'     => Input::get('email'),
                    'password'  => Input::get('password'),
                    'active'    => 1    
                ];

            if (Auth::attempt($auth)) {
                //Redirect to the intendent page
                return Redirect::intendent('/');
            }
            else{
                 return Redirect::route('account-sign-in')
                        ->with('global', 'Email/password is incorrect or account is not activated');
            }
        }
        return Redirect::route('account-sign-in')
            ->with('global', 'We are facing some problems with you sigh in.');
    }
}

0 个答案:

没有答案