Illuminate \ Database \ QueryException
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'user.deleted_at'
in 'where clause' (SQL: select * from `user` where `user`.`deleted_at` is
null and `username` = john limit 1)
因此,我将以下数据发送到我的登录路线: username=john&password=test
但是,当我在routes.php中执行以下代码时,出现上述错误。
Route::post('login', function()
{
$credentials = array(
"username" => Input::get("username"),
"password" => Input::get("password")
);
if (Auth::attempt($credentials))
{
return Redirect::intended('dashboard');
}
else {
return Redirect::to('login');
}
});
让我感到困扰的是,deleted_at
我的用户表中没有列,而且我不知道为什么当我正在尝试登录时,laravel在我的表中需要此列。
令我困扰的是我的用户表中没有delete_at列
是的,错误消息对此有所抱怨。
我不知道为什么当我正在尝试登录时,laravel为什么需要在表中的此列。
您的用户模型可能启用了软删除。$softDelete
在User.php
文件app/models
夹中的文件中查找并将其设置为false,或者如果要进行软删除,则添加该列。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句