1
我有一个用户验证问题。为登录脚本Laravel 5登录验证问题
现在:我可以创建一个新用户,并使用laravel的Hash::make
命令,以便对所有似乎正常工作见下面的数据库记录的密码。我在$input
上做了一个转储模,并确认它里面有来自登录表单的发布数据。
代码:
public function CheckLogin()
{
$input = Request::all();
// create our user data for the authentication
$userdata = array(
'Email' => $input['email'],
'Password' => $input['password']
);
// attempt to do the login
if (Auth::attempt($userdata)) {
// if(Auth::attempt(['Email' => $input['email'], 'Password' =>$input['password'], 'ArchivedOn' => null])){
//return redirect()->intended('devices');
return redirect()->intended('devices');
} else {
$err = 'Login Failed Please check credentials and try again.';
return view('welcome', compact('err'));
}
}
的Auth::attempt
似乎总是返回false,因为它总是重新定向到与我指定的错误消息的欢迎页面。
我预计我错过了一些明显的东西,但我想我会问一个新的眼睛,因为我看不到问题。
上帝我知道这将是愚蠢的感谢拉维工作 –
不客气:-) –