我现在什么都试过了。在我的auth.php中,我将其设置为:
return array(
'driver' => 'eloquent',
'username' => 'email',
'password' => 'password',
'model' => 'User',
'table' => 'users',
);
我将通过我在数据库中的列"email"和密码"password"登录用户
这是我的用户控制类,检查登录,但它每次返回false。
是的,$in['email']返回一封电子邮件,$in['password']是一个密码。是的,数据库中有这类信息的记录。
if ( Auth::attempt(array("username" => $in['email'], "password" => $in['password']))):
echo "OK!";
else:
return Redirect::to('/users/login')->with_errors($v);
endif;
如何创建密码?必须使用Hash::make()
验证器只在密码未生成Hash::make()时返回false。我也面临着这个问题,但现在使用Hash::make()创建密码后修复;