Subscribe to PHP Freaks RSS

Pineco.de: Notify Locked Out Users in Laravel

syndicated from www.phpdeveloper.org on January 7, 2019

On the Pineco.de blog they've posted a tutorial for the Laravel users out there showing how to notify locked out users making use of functionality already included with the framework.

Laravel offers a nice feature, that locks out the users that attempted to login too much. It’s a nice way to prevent brute force logins. But how can we notify the user, when the lockout happens? Maybe it wasn’t the user who attempted to log in.

The tutorial starts with the details on setting up the listener to capture the Lockout event and pass it off to a UserLockedOut class. Once this is created, they show how to use this class and, via the included "notification" system in Laravel, send an email to the user in question with more information about their account being locked.