@extends('layouts.app') @section('title', 'Ticket #' . ($ticket->ticket_number ?? 'N/A')) @section('content') @if(!isset($ticket) || !$ticket->id)
Ticket not found. Return to tickets list
@php return; @endphp @endif
TICKET #{{ $ticket->ticket_number }}
{{ ucfirst(str_replace('_', ' ', $ticket->status)) }}

{{ $ticket->subject ?? 'No Subject' }}

Created {{ $ticket->created_at->format('F j, Y \a\t g:i A') }} @if($ticket->updated_at->ne($ticket->created_at)) • Updated {{ $ticket->updated_at->format('F j, Y \a\t g:i A') }} @endif

Back @if(auth()->user()->user_type === 'admin' || auth()->user()->user_type === 'lms_manager') @if(!$ticket->assigned_to_user_id) @endif @if($ticket->status !== 'closed') @endif @endif
Ticket Details
{{ ucfirst($ticket->priority) }} Priority

{{ $ticket->description ?? 'No description provided.' }}

@if($ticket->attachment)
Attachment Available

Click download to get the attached file

Download
@endif
Conversation {{ $ticket->messages->count() }}
Last updated {{ $ticket->updated_at->format('M j, g:i A') }}
@forelse($ticket->messages as $message)
{{ substr($message->sender->username ?? 'U', 0, 1) }}
{{ $message->sender->username ?? 'Unknown User' }} @if($message->is_system_message) System @elseif($message->is_resolution_note) Resolution @endif
{{ $message->sender->user_type === 'student' ? 'Student' : ($message->sender->user_type === 'admin' ? 'Administrator' : 'LMS Manager') }}
{{ $message->created_at->format('M j, g:i A') }}
{{ $message->message }}
@if($message->attachment) @endif
@empty
No messages yet

Start the conversation by sending the first message

@endforelse
@if($ticket->status !== 'closed')
Send Reply
@csrf
Maximum file size: 10MB. Supported formats: PDF, DOC, DOCX, JPG, PNG, ZIP
@if(auth()->user()->user_type !== 'student')
@endif
@else
Ticket Closed

This ticket is closed and cannot receive new messages

@endif
@if(auth()->user()->user_type !== 'student' && $ticket->status !== 'closed')
Quick Actions
@if(!$ticket->assigned_to_user_id && auth()->user()->user_type === 'admin') @endif
@endif
Ticket Information
{{ substr($ticket->student->name ?? 'S', 0, 1) }}
{{ $ticket->student->name ?? 'Unknown Student' }} {{ $ticket->student->user->email ?? 'No email' }}
@if($ticket->assignedTo)
{{ substr($ticket->assignedTo->name, 0, 1) }}
{{ $ticket->assignedTo->username }} LMS Manager
@endif
{{ $ticket->category ?? 'Uncategorized' }}
@if($ticket->batch)
{{ $ticket->batch->name }}
@endif
{{ $ticket->created_at->format('M j, Y') }}
{{ $ticket->created_at->format('g:i A') }}
@if($ticket->updated_at->ne($ticket->created_at))
{{ $ticket->updated_at->format('M j, Y g:i A') }}
@endif
@include('complaints.models.assign') @include('complaints.models.close') @endsection @section('styles') @endsection @section('scripts') @endsection