Attachment Viewer
Select a file to preview

Choose a file from the list to view its contents

Download File
Attachments
@if($ticket->attachments && count($ticket->attachments) > 0)
Ticket Attachments
@foreach($ticket->attachments as $attachment) @if(is_array($attachment))
@php $extension = pathinfo($attachment['name'] ?? '', PATHINFO_EXTENSION); $icon = 'la-file'; $color = 'text-primary'; if(in_array($extension, ['pdf'])) { $icon = 'la-file-pdf'; $color = 'text-danger'; } elseif(in_array($extension, ['doc', 'docx'])) { $icon = 'la-file-word'; $color = 'text-primary'; } elseif(in_array($extension, ['xls', 'xlsx'])) { $icon = 'la-file-excel'; $color = 'text-success'; } elseif(in_array($extension, ['jpg', 'jpeg', 'png', 'gif', 'bmp'])) { $icon = 'la-file-image'; $color = 'text-warning'; } elseif(in_array($extension, ['mp3', 'wav', 'ogg'])) { $icon = 'la-file-audio'; $color = 'text-info'; } @endphp
{{ $attachment['name'] ?? 'Unknown' }}
@if(isset($attachment['size'])) {{ formatFileSize($attachment['size']) }} @endif • {{ strtoupper($extension) }}
@endif @endforeach
@endif @if($ticket->allTasks->count() > 0) @php $hasTaskAttachments = false; foreach($ticket->allTasks as $task) { if($task->attachments && count($task->attachments) > 0) { $hasTaskAttachments = true; break; } } @endphp @if($hasTaskAttachments)
Task Attachments
@foreach($ticket->allTasks as $task) @if($task->attachments && count($task->attachments) > 0) @foreach($task->attachments as $attachment) @if(is_array($attachment))
@php $extension = pathinfo($attachment['name'] ?? '', PATHINFO_EXTENSION); $icon = 'la-file'; $color = 'text-primary'; if(in_array($extension, ['pdf'])) { $icon = 'la-file-pdf'; $color = 'text-danger'; } elseif(in_array($extension, ['doc', 'docx'])) { $icon = 'la-file-word'; $color = 'text-primary'; } elseif(in_array($extension, ['xls', 'xlsx'])) { $icon = 'la-file-excel'; $color = 'text-success'; } elseif(in_array($extension, ['jpg', 'jpeg', 'png', 'gif', 'bmp'])) { $icon = 'la-file-image'; $color = 'text-warning'; } elseif(in_array($extension, ['mp3', 'wav', 'ogg'])) { $icon = 'la-file-audio'; $color = 'text-info'; } @endphp
{{ $attachment['name'] ?? 'Unknown' }}
@if(isset($attachment['size'])) {{ formatFileSize($attachment['size']) }} @endif • {{ strtoupper($extension) }}
{{ $task->tsk_id }}
@endif @endforeach @endif @endforeach
@endif @endif @if($ticket->replies->count() > 0) @php $hasReplyAttachments = false; foreach($ticket->replies as $reply) { if($reply->attachments && (count($reply->attachments['documents'] ?? []) > 0 || count($reply->attachments['audio'] ?? []) > 0)) { $hasReplyAttachments = true; break; } } @endphp @if($hasReplyAttachments)
Reply Attachments
@foreach($ticket->replies as $reply) @if($reply->attachments) @foreach($reply->attachments['documents'] ?? [] as $document)
@php $extension = pathinfo($document['name'] ?? '', PATHINFO_EXTENSION); $icon = 'la-file'; $color = 'text-primary'; if(in_array($extension, ['pdf'])) { $icon = 'la-file-pdf'; $color = 'text-danger'; } elseif(in_array($extension, ['doc', 'docx'])) { $icon = 'la-file-word'; $color = 'text-primary'; } elseif(in_array($extension, ['xls', 'xlsx'])) { $icon = 'la-file-excel'; $color = 'text-success'; } elseif(in_array($extension, ['jpg', 'jpeg', 'png', 'gif', 'bmp'])) { $icon = 'la-file-image'; $color = 'text-warning'; } @endphp
{{ $document['name'] ?? 'Unknown' }}
@if(isset($document['size'])) {{ formatFileSize($document['size']) }} @endif • {{ strtoupper($extension) }}
Reply #{{ $reply->id }}
@endforeach @foreach($reply->attachments['audio'] ?? [] as $audio)
{{ $audio['name'] ?? 'Unknown' }}
@if(isset($audio['size'])) {{ formatFileSize($audio['size']) }} @endif • AUDIO
Reply #{{ $reply->id }}
@endforeach @endif @endforeach
@endif @endif @if((!$ticket->attachments || count($ticket->attachments) == 0) && (!$hasTaskAttachments) && (!$hasReplyAttachments))
No Attachments

No files have been attached to this ticket yet.

@endif