diff --git a/app/Http/Livewire/Notifications.php b/app/Http/Livewire/Notifications.php index c3e2988fe..90fcf4a7f 100644 --- a/app/Http/Livewire/Notifications.php +++ b/app/Http/Livewire/Notifications.php @@ -3,7 +3,6 @@ namespace App\Http\Livewire; use App\Policies\NotificationPolicy; -use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Notifications\DatabaseNotification; use Illuminate\Support\Facades\Auth; @@ -34,7 +33,7 @@ public function getNotificationProperty(): DatabaseNotification return DatabaseNotification::findOrFail($this->notificationId); } - public function markAsRead(string $notificationId): LengthAwarePaginator + public function markAsRead(string $notificationId): void { $this->notificationId = $notificationId; @@ -42,10 +41,6 @@ public function markAsRead(string $notificationId): LengthAwarePaginator $this->notification->markAsRead(); - $unreadNotifications = Auth::user()->unreadNotifications()->paginate(10); - - $this->emit('NotificationMarkedAsRead', $unreadNotifications->total()); - - return $unreadNotifications; + $this->emit('NotificationMarkedAsRead', Auth::user()->unreadNotifications()->count()); } }