unreadNotifications; } else { $notifications = $user->notifications()->paginate($page); } return $notifications; } function markAllAsRead(): void { Auth::user()->unreadNotifications->markAsRead(); } // I want to return the read notification function markAsRead(string $id) { $notification = Auth::user()->notifications->find($id); if ($notification) { $notification->markAsRead(); } return $notification; } }