Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/270.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel身份验证抛出异常错误_Php_Laravel_Laravel 4 - Fatal编程技术网

Php Laravel身份验证抛出异常错误

Php Laravel身份验证抛出异常错误,php,laravel,laravel-4,Php,Laravel,Laravel 4,因此,我将以下数据发送到我的登录路径:username=john&password=test 但是当我在我的routes.php中执行以下代码时,我得到了上面显示的错误 Illuminate \ Database \ QueryException SQLSTATE[42S22]: Column not found: 1054 Unknown column 'user.deleted_at' in 'where clause' (SQL: select * from `user` where `u

因此,我将以下数据发送到我的登录路径:
username=john&password=test

但是当我在我的routes.php中执行以下代码时,我得到了上面显示的错误

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)
困扰我的是,我的用户表中没有
deleted\u at
列,我不知道为什么当我尝试登录时,laravel需要删除我表中的该列

困扰我的是,我没有删除用户表中的_at列

是的,错误消息正在对此进行抱怨

我不知道为什么laravel需要在我的表中添加此列,而我所做的只是尝试登录


您的用户模型可能已启用。在
app/models
文件夹中的
User.php
文件中查找
$softDelete
,并将其设置为false,或者在需要软删除的情况下添加列。

这是否意味着当我使用迁移创建用户表时,我需要手动添加删除的列?根据迁移文档,
$table->softDeletes()在迁移中添加该列。好的,看起来我需要RTFM。谢谢。我用
$table->softDeletes()添加了一个新的迁移就像你说的那样,它成功了!万分感谢!
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');
    }

});