@extends('layouts.app') @section('title', 'Chat — ' . ($conversation->subject ?? 'Support')) @push('styles') @endpush @section('content')
All Chats {{ ucfirst($conversation->status) }}
@if(in_array($conversation->status, ['resolved','closed']))
This conversation has been {{ $conversation->status }}. Start a new chat if you need more help.
@endif
{{ $conversation->subject ?? 'Support Chat' }}
@if($conversation->agent)
Agent: {{ $conversation->agent->name }}
@else
Waiting for agent...
@endif
Started {{ $conversation->created_at->format('d M Y') }}
@forelse($messages as $msg) @php $isMine = $msg->sender_id === auth()->id(); @endphp
@if($msg->sender->avatar) @else
{{ strtoupper(substr($msg->sender->name,0,2)) }}
@endif
@if(!$isMine)
{{ $msg->sender->name }}
@endif
{{ $msg->message }}
{{ $msg->created_at->format('H:i') }}
@empty
Send a message to start the conversation.
@endforelse
@if(!in_array($conversation->status, ['resolved','closed']))
@csrf
@endif
@push('scripts') @endpush @endsection