Subject: {{ $ticket->subject }}
Created At: {{ $ticket->created_at->format('d M, Y h:i A') }}
@if ($ticket->user)
Submitted By: {{ $ticket->user->name }} ({{ $ticket->user->email }})
@endif
Description:
{{ $ticket->description }}
@if ($ticket->attachments && is_array($ticket->attachments))
@endif
@foreach ($ticket->replies as $reply)
@php
$isSelf = $reply->user_id === auth()->id();
$name = $reply->user->name ?? 'Staff';
$avatarInitials = collect(explode(' ', $name))
->map(fn($word) => strtoupper(substr($word, 0, 1)))
->join('');
@endphp
@if (!$isSelf)
{{ $avatarInitials }}
@endif
{{ $reply->message }}
@if ($reply->attachments && is_array($reply->attachments))
@endif
{{ $name }} •
{{ $reply->created_at->diffForHumans() }}
@if ($isSelf)
{{ $avatarInitials }}
@endif
@endforeach
@if ($ticket->status !== 'closed')
@endif