File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change 33namespace App \Http \Livewire ;
44
55use App \Policies \NotificationPolicy ;
6- use Illuminate \Contracts \Pagination \LengthAwarePaginator ;
76use Illuminate \Foundation \Auth \Access \AuthorizesRequests ;
87use Illuminate \Notifications \DatabaseNotification ;
98use Illuminate \Support \Facades \Auth ;
@@ -34,18 +33,14 @@ public function getNotificationProperty(): DatabaseNotification
3433 return DatabaseNotification::findOrFail ($ this ->notificationId );
3534 }
3635
37- public function markAsRead (string $ notificationId ): LengthAwarePaginator
36+ public function markAsRead (string $ notificationId ): void
3837 {
3938 $ this ->notificationId = $ notificationId ;
4039
4140 $ this ->authorize (NotificationPolicy::MARK_AS_READ , $ this ->notification );
4241
4342 $ this ->notification ->markAsRead ();
4443
45- $ unreadNotifications = Auth::user ()->unreadNotifications ()->paginate (10 );
46-
47- $ this ->emit ('NotificationMarkedAsRead ' , $ unreadNotifications ->total ());
48-
49- return $ unreadNotifications ;
44+ $ this ->emit ('NotificationMarkedAsRead ' , Auth::user ()->unreadNotifications ()->count ());
5045 }
5146}
You can’t perform that action at this time.
0 commit comments