Skip to content

Commit

Permalink
Fixup! Notifications - When a notification is dispatched to many user…
Browse files Browse the repository at this point in the history
…s, ensure that if one of them acknowledges it, the notification is removed for all users.
  • Loading branch information
csavelief committed Sep 11, 2024
1 parent 27bdb26 commit ff41cf0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit ff41cf0

Please sign in to comment.