@extends('layouts.app') @section('title', 'Chat') @section('content')
@php $otherUser = $chat->buyer_id === auth()->id() ? $chat->seller : $chat->buyer; @endphp Chat with {{ $otherUser->name }}
{{ $conversationOtherUser->name }} @if($conversationOtherUser->company_name) ({{ $conversationOtherUser->company_name }}) @endif
@if($conversation->last_message_at) {{ $conversation->last_message_at->diffForHumans() }} @endif@if($conversation->last_message) {{ Str::limit($conversation->last_message, 40) }} @else No messages yet @endif
@if($unreadCount > 0 && $conversation->id !== $chat->id)Start a conversation from the marketplace.
{{ auth()->user()->isBuyer() ? 'Seller' : 'Buyer' }}
Start the conversation by sending a message.