且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Laravel Auth:attempt() 不会持续登录

更新时间:2023-12-03 22:36:22

我遇到了这个问题.更改用户模型的主键对我有帮助.

I had this problem. Changing primary key for user model helped for me.

尝试添加类似的东西

protected $primaryKey = 'user_id';

在类 User{} (app/models/User.php) 中

in class User{} (app/models/User.php)

(字段 user_id 是我的 Schema 中 'users' 表的自动增量键)

(Field user_id is auto increment key in my Schema for 'users' table)

另见这张票:https://github.com/laravel/framework/issues/161