Skip to content

Commit

Permalink
Added conversation isParticipant property #26 (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
myckhel authored Jul 14, 2021
1 parent 47c2c17 commit 4112995
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Http/Controllers/ConversationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 4112995

Please sign in to comment.