diff --git a/src/Http/Controllers/ConversationController.php b/src/Http/Controllers/ConversationController.php index 3c6c66e..27fc2f1 100644 --- a/src/Http/Controllers/ConversationController.php +++ b/src/Http/Controllers/ConversationController.php @@ -31,6 +31,7 @@ public function index(PaginableRequest $request) ->whereHasLastMessage($user) ->withCount([ 'messages as latest_message_at' => fn ($q) => $q->select(DB::raw('max(created_at)')), + 'participant as isParticipant' => fn ($q) => $q->whereUserId($user->id), 'unread', ]) ->orderByDesc('latest_message_at')