Php laracasts教程身份验证失败
我试着运行下面的代码,发现“用户密码的存储工作不正常”。我尝试删除数据库中的所有条目,但问题仍然存在。代码如下:Php laracasts教程身份验证失败,php,authentication,laravel-4,passwords,Php,Authentication,Laravel 4,Passwords,我试着运行下面的代码,发现“用户密码的存储工作不正常”。我尝试删除数据库中的所有条目,但问题仍然存在。代码如下: $user = new User; $user->fname = 'joe'; $user->lname = 'joe'; $user->email = 'joe@gmail.com'; $user->password = Hash::make('123456'); if ( ! ($user->save())) { dd('us
$user = new User;
$user->fname = 'joe';
$user->lname = 'joe';
$user->email = 'joe@gmail.com';
$user->password = Hash::make('123456');
if ( ! ($user->save()))
{
dd('user is not being saved to database properly - this is the problem');
}
if ( ! (Hash::check('123456', Hash::make('123456'))))
{
dd('hashing of password is not working correctly - this is the problem');
}
if ( ! (Auth::attempt(array('email' => 'joe@gmail.com', 'password' => '123456'))))
{
dd('storage of user password is not working correctly - this is the problem');
}
else
{
dd('everything is working when the correct data is supplied - so the problem is related to your forms and the data being passed to the function');
}
这个问题的原因可能是什么?我正在尝试对登录进行身份验证。哦,这只是一个愚蠢的错误,我确实尝试将数据库中密码和用户名字段的长度/值从50更改为255。然后删除数据库的所有记录。完成此操作后,我的登录身份验证现在开始工作