Laravel Auth:attempt() will not persist login

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

Try to add something like

protected $primaryKey = 'user_id';

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

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

See also this ticket: https://github.com/laravel/framework/issues/161

Leave a Comment