@extends('layouts.user_type.auth') @php $tdCompany = $ticket->companyProfile?->company_name; $tdStatus = match ($ticket->status) { 'Open' => 'z-badge--warning', 'In Progress' => 'z-badge--info', 'Resolved' => 'z-badge--success', default => '', }; $tdPriority = match ($ticket->priority) { 'Urgent' => 'z-badge--danger', 'High' => 'z-badge--warning', 'Medium' => 'z-badge--info', default => '', }; $tdCustInit = $tdCompany ? collect(preg_split('/\s+/', trim($tdCompany)))->filter()->take(2)->map(fn ($w) => mb_strtoupper(mb_substr($w, 0, 1)))->implode('') : 'CU'; $tdMeName = auth()->user()?->name ?: 'You'; $tdMeInit = collect(preg_split('/\s+/', trim($tdMeName)))->filter()->take(2)->map(fn ($w) => mb_strtoupper(mb_substr($w, 0, 1)))->implode(''); @endphp @section('pageEyebrow'){{ $ticket->ticket_number }}@endsection @section('pageTitle', $ticket->subject) @section('pageSub') {{ ucfirst($ticket->status) }} {{ ucfirst($ticket->priority) }} priority {{ $tdCompany ?? 'Unknown client' }}@if($ticket->created_at) · opened {{ $ticket->created_at->format('j M Y, g:i A') }}@endif @endsection @section('pageActions') All tickets @endsection @section('ticketSupportIndividual') @include('components.alert')
{{-- Conversation --}}
Conversation
{{ count($messages) }} messages
@forelse ($messages as $message) @php $stMine = $message->sent_by == 'Admin To Customer'; @endphp
{{ $stMine ? $tdMeInit : $tdCustInit }}
{{ $stMine ? 'You' : 'Customer' }} @if($message->created_at){{ $message->created_at->format('j M, g:i A') }}@endif
{{ $message->message }}
@if ($message->attachment) Download attachment @endif
@empty
No messages yet
@endforelse
@if($ticket->status != 'Closed')
@csrf
@else
This ticket is closed

The conversation is read-only.@if (hasPermission('ticketSupport', 'insert')) Reopen the ticket to reply.@endif

@endif
{{-- Side --}}
@endsection