@extends('admin.layouts.app') @section('title', 'Support Ticket | EMI CREDITS Admin') @section('page-title', 'Support Ticket') @section('page-description', 'Client support conversation') @section('content') @push('styles') @endpush
{{-- BACK --}} ← Back to Support {{-- Intentionally no success alert here. Reply/status update should not show green message. --}} {{-- ========================= TICKET HEADER ========================== --}}
{{ $ticket->subject }}
Client: {{ $ticket->client->name ?? 'Unknown' }} @if($ticket->client) · {{ $ticket->client->email }} @endif
{{-- STATUS --}}
@if($ticket->status === 'pending') Pending @elseif($ticket->status === 'in_progress') In Progress @else Closed @endif
{{-- ========================= STATUS UPDATE ========================== --}}
@csrf @method('PATCH')
{{-- ========================= CHAT ========================== --}}
{{-- CHAT HEADER --}}
Conversation
Client support messages
{{-- ========================= CHAT BODY ========================== --}}
@forelse($ticket->messages as $message) @php $isAdmin = $message->user_id === auth()->id(); $clientName = $ticket->client->name ?? 'Client'; @endphp
{{-- AVATAR --}}
@if($isAdmin) A @else {{ strtoupper(substr($clientName, 0, 1)) }} @endif
{{-- MESSAGE --}}
@if($isAdmin) Admin @else {{ $clientName }} @endif
{!! nl2br(e($message->message)) !!}
{{ $message->created_at ? $message->created_at->format('d M Y, h:i A') : '' }}
@empty
No messages yet Start the conversation with the client.
@endforelse
{{-- ========================= REPLY ========================== --}}
@if($ticket->status === 'closed')
This ticket is closed. You cannot send a reply.
@else
@csrf
@endif
@endsection @push('scripts') @endpush