notify(new SomeNotification(...)); * * we now do * * SafeNotifier::send($user, new SomeNotification(...)); * * which runs the same code, catches any Throwable, and writes a warning line * so ops still has the signal. */ class SafeNotifier { /** * @param mixed $notifiable Anything with ->notify(), usually a User. */ public static function send(mixed $notifiable, Notification $notification): void { if (! $notifiable || ! is_object($notifiable) || ! method_exists($notifiable, 'notify')) { return; } try { $notifiable->notify($notification); } catch (\Throwable $e) { Log::warning('notification send failed', [ 'notification' => $notification::class, 'notifiable' => $notifiable::class, 'notifiable_id'=> $notifiable->getKey() ?? null, 'error' => $e->getMessage(), ]); } } }