In this tutorial we're going to create a new Laravel listener that will listen to the user logged in event and then update the user record with the time they logged in. This is a handy feature to check how often your users are logging in and which ones are most active in your application.
The event we're going to listen for is Illuminate\Auth\Events\Login which will run when the user logs into your application.
https://paulund.co.uk/laravel-user-last-logged-in#logged-in-listenerWith the new column created we can listen for the logged in event and save the current date time to the user column.
Now whenever a user logs into your application we'll store the last time that user was able to login.