From b80f353c646d535b199335011293a10b0d3675e6 Mon Sep 17 00:00:00 2001 From: Gabriel Peixoto Date: Tue, 28 Jan 2020 14:38:37 -0300 Subject: [PATCH] event triggered only once a day --- src/Middleware/BlockBots.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Middleware/BlockBots.php b/src/Middleware/BlockBots.php index 641bf13..17e31fb 100644 --- a/src/Middleware/BlockBots.php +++ b/src/Middleware/BlockBots.php @@ -112,7 +112,7 @@ public function blocked($request, $dailyLimit) if ($fake_mode) { return false; } else { - if (Auth::check()) { + if (Auth::check() && $number_of_hits == $dailyLimit + 1) { event(new UserBlockedEvent(Auth::user(), $number_of_hits, Carbon::now())); } return true;