From ff41cf0686ea88f4360d9508f83474cbdc51f495 Mon Sep 17 00:00:00 2001 From: csavelief Date: Wed, 11 Sep 2024 09:40:44 +0200 Subject: [PATCH] Fixup! Notifications - When a notification is dispatched to many users, ensure that if one of them acknowledges it, the notification is removed for all users. --- routes/web.php | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/web.php b/routes/web.php index fd1fdb6..cf221ba 100644 --- a/routes/web.php +++ b/routes/web.php @@ -401,6 +401,7 @@ Route::get('/notifications/{notification}/dismiss', function (\Illuminate\Notifications\DatabaseNotification $notification, \Illuminate\Http\Request $request) { \Illuminate\Notifications\DatabaseNotification::query() + ->whereNull('read_at') ->whereJsonContains('data->group', $notification->data['group']) ->get() ->each(fn($notif) => $notif->markAsRead());