I want to send an email notification whenever a user reaches the maximum allowed login attempts (i.e. user is locked out).
What would be the best way to do this? I see a fireLockoutEvent method in the ThrottlesLogins class, should I be listening for that event? And where should I do that?
Yes. Create a listener for the event
LockoutEvent
.The LockoutEventListener.php is created under the folder
app/Listeners/LockoutEventListener
. Then register theLockoutEvent
listener to the application inapp/providers/EventServiceProvider.php
.EventServiceProvider.php
Then update the handler method of the event
LockoutEvent
.LockoutEventListener.php