Fix AdminNotificationService crashing on string throttle_minutes config

env('ERROR_NOTIFICATION_THROTTLE_MINUTES', 15) returns the literal string
"15" from production's .env (env() doesn't cast numeric strings), which
Carbon 3.11's addMinutes() rejects with a TypeError. That crash happened
before the throttle-dedup cache write, so it silently masked the *original*
exception on every notify-worthy error, indefinitely (discovered while
investigating a missing workshop-registration email — the real SMTP error
was hidden behind this crash). Cast to (int).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Naser Mansour
2026-09-28 00:45:27 +03:00
parent ac22a0b982
commit 6ae226f5f2
4 changed files with 118 additions and 1 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ class AdminNotificationService
}
$errorKey = $this->getErrorKey($exception);
$throttleMinutes = config('libra.notifications.throttle_minutes', 15);
$throttleMinutes = (int) config('libra.notifications.throttle_minutes', 15);
if (Cache::has($errorKey)) {
return;