From d2a2a354105168266f92743874eb9cbf3f19b7fa Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Sat, 24 Jan 2026 12:58:57 +0530 Subject: [PATCH] changed logic in push alert notification page --- app/Notifications/PushAlertNotification.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/Notifications/PushAlertNotification.php b/app/Notifications/PushAlertNotification.php index e4b8081..4a8ac79 100644 --- a/app/Notifications/PushAlertNotification.php +++ b/app/Notifications/PushAlertNotification.php @@ -31,9 +31,25 @@ class PushAlertNotification extends Notification $this->body = $body; } + // public function via($notifiable) + // { + // return [WebPushChannel::class]; + // } + public function via($notifiable) { - return [WebPushChannel::class]; + return [ + 'database', // ✅ Filament toast + WebPushChannel::class // ✅ Browser / PWA push + ]; + } + + public function toDatabase($notifiable): array + { + return [ + 'title' => $this->title, + 'body' => $this->body, + ]; } // public function toWebPush($notifiable, $notification)