public function postLogin(Request $request){ if($input=Input::all()){ if(!Auth::attempt(['phone' => $input['mobile'], 'password' => $input['password']])){ return back()->with('msg', '用户名或者密码错误!'); } return redirect('');}
With this method has been an error, why Ah, I tried, the account password is correct, but always error is the user name or password errors
Reply content:
public function postLogin(Request $request){ if($input=Input::all()){ if(!Auth::attempt(['phone' => $input['mobile'], 'password' => $input['password']])){ return back()->with('msg', '用户名或者密码错误!'); } return redirect('');}
With this method has been an error, why Ah, I tried, the account password is correct, but always error is the user name or password errors
If you make sure that your user name and password are right. Then we'll see Auth::attempt() how you handle usernames and passwords, and there's a good chance that the problem is here. Auth::attempt()
Output the SQL statement executed to see if the user password entered is correct
\DB::connection()->enableQueryLog();$queries = \DB::getQueryLog();dd($queries );