我在我的AuthController中有这样的登录代码。如何在laravel中验证登录5.3
public function login(Request $request){
$email = $request->input('email');
$password = $request->input('password');
$validation = array(
'email' =>'required',
'password' => 'required');
$validator = Validator::make($request->all(), $validation);
if ($validator->fails()) {
$messages = $validator->messages();
return redirect('login_with_assismo')
->withErrors($validator)
->withInput(Input::except('password'));
} else {
if (auth()->authenticate()) {
return redirect()->intended('welcome');
}
}
}
当我使用这是我认为的登录执行,但它重定向我的页面somthng这样 本地主机:8000 /登录
任何人帮助我如何验证登录我做错了什么或什么。请为此获取解决方案。
为localhost替换这条路线:8000 /首页 这是找不到页面。 –
而我的密码是加密形式的 –
你不必担心密码,因为Laravel的'attempt()'函数会自动为你做。另外,我已经更新了答案,请使用它。而对于你面临的问题,你需要手动检查它使用'dd()'重定向到哪一行。我会建议你彻底阅读文件。 –