Filters

@forelse($conversations as $conversation) @php $conversationListing = $conversation->listing; $partner = (int) $conversation->buyer_id === (int) auth()->id() ? $conversation->seller : $conversation->buyer; $isSelected = $selectedConversation && (int) $selectedConversation->id === (int) $conversation->id; $conversationImage = $conversationListing?->getFirstMediaUrl('listing-images'); $lastMessage = trim((string) ($conversation->lastMessage?->body ?? '')); @endphp
@if($conversationImage) {{ $conversationListing?->title }} @else
Listing
@endif

{{ $partner?->name ?? 'User' }}

{{ $conversation->last_message_at?->format('d.m.Y') }}

{{ $conversationListing?->title ?? 'Listing removed' }}

{{ $lastMessage !== '' ? $lastMessage : 'No messages yet' }}

@if($conversation->unread_count > 0) {{ $conversation->unread_count }} @endif
@empty
No conversations yet.
@endforelse