@extends('layout.mainlayout') @section('content')
@component('components.breadcrumb') @slot('title') Ticket #{{ $ticket->id }} @endslot @endcomponent @if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif @if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif @php $currentUserId = Auth::id(); $isAssignee = $currentUserId === $ticket->assignee_id; $isResolver = $currentUserId === $ticket->resolver_id; $canAssign = Auth::user()->can('ticket-assign'); $canResolve = Auth::user()->can('ticket-resolve'); $showActionGroup = $isAssignee || $isResolver || $canAssign || $canResolve; $statusClass = match ($ticket->status) { 'OPEN' => 'bg-warning text-dark', 'ASSIGNED' => 'bg-primary', 'IN_PROGRESS' => 'bg-info text-dark', 'PENDING' => 'bg-secondary', 'RESOLVED' => 'bg-success', 'CLOSED' => 'bg-dark', 'REOPENED' => 'bg-danger', 'ESCALATED' => 'bg-danger', default => 'bg-light text-dark', }; $priorityClass = match ($ticket->priority) { 'CRITICAL' => 'bg-danger', 'HIGH' => 'bg-danger', 'MEDIUM' => 'bg-warning text-dark', 'LOW' => 'bg-info text-dark', default => 'bg-light text-dark', }; @endphp
Support Ticket

#{{ $ticket->id }} - {{ $ticket->subject }}

{{ $ticket->status }} @if (!empty($ticket->priority)) {{ $ticket->priority }} Priority @endif
Created: {{ $ticket->created_at?->format('d M Y, h:i A') ?? '—' }}
Due: {{ $ticket->tat_at?->format('d M Y, h:i A') ?? '—' }}
Ticket Summary
Raised By
{{ $ticket->user->name ?? '—' }}
{{ $ticket->user->email ?? '—' }}
Phone
{{ $ticket->user_phone ?? '—' }}
Location
{{ $ticket->location->name ?? ($ticket->location_name ?? '—') }}
Project
{{ $ticket->project->name ?? ($ticket->project_name ?? '—') }}
Department
{{ $ticket->department->name ?? '—' }}
Attachment
@if (!empty($ticket->attachment_path)) View / Download @else — @endif

Details
{{ $ticket->details }}
Activity Timeline
@if ($ticket->updates->isEmpty())

No updates yet.

@else
@foreach ($ticket->updates->sortByDesc('created_at') as $log)
{{ $log->user->name ?? 'System' }}
{{ $log->created_at?->format('d M Y, h:i A') }}
@if ($log->old_status || $log->new_status)
Status: {{ $log->old_status ?? '—' }} → {{ $log->new_status ?? '—' }}
@endif @if ($log->priority_from || $log->priority_to)
Priority: {{ $log->priority_from ?? '—' }} → {{ $log->priority_to ?? '—' }}
@endif @if ($log->tat_due_at)
TAT set to: {{ \Carbon\Carbon::parse($log->tat_due_at)->format('d M Y, h:i A') }}
@endif @if ($log->comment)

{{ $log->comment }}

@endif @if (!empty($log->attachment_path)) View Attachment @endif
@endforeach
@endif
Assignment
Assignee
{{ $ticket->assignee->name ?? '—' }}
{{ $ticket->assignee->email ?? '' }}
Resolver
{{ $ticket->resolver->name ?? '—' }}
{{ $ticket->resolver->email ?? '' }}
@if (Auth::user()->can('ticket-assign'))
@csrf
@endif
Actions
@can('accept', $ticket) @if ($ticket->status !== 'IN_PROGRESS')
@csrf
@endif @endcan @if ($showActionGroup)
@csrf
@csrf
@endif @if ($isResolver || $canResolve)
@csrf
@endif
@can('reopen', $ticket) @if (in_array($ticket->status, ['RESOLVED', 'CLOSED']))
@csrf
@endif @endcan @can('escalate', $ticket) @if (!in_array($ticket->status, ['CLOSED', 'ESCALATED']))
@csrf
@endif @endcan
@endsection @push('styles') @endpush