mirror of
https://github.com/flarum/core.git
synced 2025-08-02 14:37:49 +02:00
Mark all notifications with the same subject as read
This commit is contained in:
@@ -31,8 +31,12 @@ class ReadNotificationHandler
|
|||||||
|
|
||||||
$notification = Notification::where('user_id', $actor->id)->findOrFail($command->notificationId);
|
$notification = Notification::where('user_id', $actor->id)->findOrFail($command->notificationId);
|
||||||
|
|
||||||
$notification->read();
|
Notification::where([
|
||||||
$notification->save();
|
'user_id' => $actor->id,
|
||||||
|
'type' => $notification->type,
|
||||||
|
'subject_id' => $notification->subject_id
|
||||||
|
])
|
||||||
|
->update(['is_read' => true]);
|
||||||
|
|
||||||
return $notification;
|
return $notification;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user