{{-- Top Bar & Header --}}

{{ $ticket->subject }}

@if($ticket->status === 'open') Open @elseif($ticket->status === 'answered') Answered @elseif($ticket->status === 'closed') Closed @else {{ ucfirst($ticket->status) }} @endif
#{{ $ticket->id }} {{ $ticket->product->title ?? 'General Inquiry' }} Opened {{ $ticket->created_at->format('M d, Y') }}
{{-- Conversation Thread --}}
{{-- Original Message (User) --}}
{{ $ticket->created_at->format('M d, Y \a\t H:i') }} {{ auth()->user()->name ?? 'You' }}
{{ auth()->user()?->initials() ?? 'U' }}

{{ $ticket->body ?? $ticket->message ?? '' }}

{{-- Attachments for initial message --}} @if($ticket->attachments->where('reply_id', null)->count() > 0)
@foreach ($ticket->attachments->where('reply_id', null) as $attachment) {{ $attachment->file_name }} @endforeach
@endif
{{-- Replies --}} @if(isset($ticket->replies)) @foreach ($ticket->replies as $reply) @php $isAdmin = $reply->user && $reply->user->hasRole('admin'); @endphp @if($isAdmin) {{-- Admin Reply (Left aligned) --}}
Support Team Staff {{ $reply->created_at->format('M d, Y \a\t H:i') }}

{{ $reply->body }}

{{-- Attachments for this reply --}} @if($ticket->attachments->where('reply_id', $reply->id)->count() > 0)
@foreach ($ticket->attachments->where('reply_id', $reply->id) as $attachment) {{ $attachment->file_name }} @endforeach
@endif
@else {{-- User Reply (Right aligned) --}}
{{ $reply->created_at->format('M d, Y \a\t H:i') }} {{ $reply->user->name ?? 'You' }}
{{ strtoupper(substr($reply->user->name ?? 'U', 0, 1)) }}

{{ $reply->body }}

{{-- Attachments for this reply --}} @if($ticket->attachments->where('reply_id', $reply->id)->count() > 0)
@foreach ($ticket->attachments->where('reply_id', $reply->id) as $attachment) {{ $attachment->file_name }} @endforeach
@endif
@endif @endforeach @endif
{{-- Reply Form --}} @if($ticket->status !== 'closed')
@if ($errors->any())
    @foreach ($errors->all() as $e)
  • {{ $e }}
  • @endforeach
@endif
@csrf

Please avoid sharing sensitive passwords.

@else

This ticket is closed.

Open a new ticket if you need further assistance.

@endif