@extends('layouts.admin') @section('title', 'Ticket #' . $ticket->ticket_number) @section('content') @if(session('success')) @endif
Ticket Details
{{ ucfirst(str_replace('_', ' ', $ticket->category)) }}
@php $priorityColors = [ 'low' => 'bg-success', 'medium' => 'bg-info', 'high' => 'bg-warning', 'urgent' => 'bg-danger' ]; @endphp {{ ucfirst($ticket->priority) }} Priority

{{ $ticket->description }}

@if($ticket->attachment) @endif
Created {{ $ticket->created_at->diffForHumans() }} • {{ $ticket->created_at->format('M d, Y h:i A') }}
Conversation ({{ $ticket->replies->count() }} replies)
@forelse($ticket->replies as $reply)
{{ strtoupper(substr($reply->user->name ?? ($reply->is_admin_reply ? 'A' : 'U'), 0, 1)) }}
{{ $reply->user->name ?? ($reply->is_admin_reply ? 'Admin' : 'User') }} @if($reply->is_admin_reply) Admin @endif {{ $reply->created_at->diffForHumans() }}

{{ $reply->message }}

@if($reply->attachment) Attachment @endif
@empty
No replies yet
@endforelse @if($ticket->status != 'closed')
Add Reply
@csrf
@else
This ticket is closed. It cannot be replied to.
@endif
Ticket Info
Store {{ $ticket->restaurant->name ?? 'N/A' }}
Submitted By {{ $ticket->user->name ?? 'N/A' }}
{{ $ticket->user->email ?? '' }}
Ticket Number {{ $ticket->ticket_number }}
Status {{ ucfirst(str_replace('_', ' ', $ticket->status)) }}
Priority {{ ucfirst($ticket->priority) }}
Category {{ ucfirst(str_replace('_', ' ', $ticket->category)) }}
Assigned To @if($ticket->assigned_to) {{ $ticket->assignedAdmin->name ?? 'Unknown' }} @else Unassigned @endif
Created {{ $ticket->created_at->format('M d, Y h:i A') }}
@if($ticket->resolved_at)
Resolved {{ $ticket->resolved_at->format('M d, Y h:i A') }}
@endif
Quick Links
@if($ticket->restaurant_id) View Restaurant @endif @if($ticket->user_id) View User @endif @if(!$ticket->restaurant_id && !$ticket->user_id) No related record is linked to this ticket. @endif
@endsection