Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

N3OGeorgy's avatar

Customizing Laravel 8 Fortify Login Rate Limiter

Hello,

In the app\Providers\FortifyServiceProvider.php boot function there is a rate limiter for login and two-factor:

        RateLimiter::for('login', function (Request $request) {
            return Limit::perMinute(5)->by($request->email.$request->ip());
        });

How i can do something like sending an email when the limiter was reached? In the documentation https://laravel.com/api/8.x/Illuminate/Cache/RateLimiter.html i see a tooManyAttempts function, but how i can use it in this case?

0 likes
1 reply

Please or to participate in this conversation.