mirror of
https://github.com/flarum/framework.git
synced 2024-11-28 20:16:08 +08:00
Only update notifications that are not already marked as read (#3202)
This commit is contained in:
parent
6a5afd1e4f
commit
eb7382b672
|
@ -50,6 +50,8 @@ class NotificationRepository
|
||||||
*/
|
*/
|
||||||
public function markAllAsRead(User $user)
|
public function markAllAsRead(User $user)
|
||||||
{
|
{
|
||||||
Notification::where('user_id', $user->id)->update(['read_at' => Carbon::now()]);
|
Notification::where('user_id', $user->id)
|
||||||
|
->whereNull('read_at')
|
||||||
|
->update(['read_at' => Carbon::now()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user