Sure you didn't use remember login, and user is still logged in.
Login event doesn't fire at first login
So, I want to update a user's last login time whenever they log in and I've run into this problem. I'm using Laravel's own login (which is based on the AuthenticatesUsers trait) and its own Login event (Illuminate\Auth\Events\Login) in a subscriber. They're bound like this in the subscribe() method of the listener:
$events->listen(
'Illuminate\Auth\Events\Login',
'App\Listeners\AuthEventListener@onLogin'
);
Now, I know the onLogin method is always hit (whenever I dd or do logging in it, it's triggered) but it doesn't update the user's last login column in the database. However, when I log out and login again, this time the column is updated. It's like that for every other user. Doesn't update the database at first login, but updates it with no problem if you log in for a second time after logging out.
Anybody has any idea why that might be happening?
Thanks in advance.
Please or to participate in this conversation.