Thursday, March 30, 2017

Laravel Auth::attempt always return false?

Here is myscreen shot of database and my login input enter image description here

public function action(Request $request){
         $username = $request->username;
         $pass = bcrypt($request->password);
         $credentials = [
                         'id' => $username,
                         'password' => $pass
                        ];

    dd(Auth::attempt($credentials));
         if (Auth::attempt(['id' => $username, 'password' => $pass])) {
            echo 'Ok';
         }else{
            echo 'Not ok';
         }

I'm trying to make a login action using laravel auth::attemptbut it always return false.



via Reynald Henryleo

Advertisement