{{-- Upload Section --}} @if($this->canUpload && $settings['enabled'])
{{-- Section Header --}}

Attachments

Upload files to support your request

{{ $uploadedAttachments->count() }} / {{ $this->maxFiles }}
files uploaded
{{-- File Upload Input --}}
{{-- Upload Progress Bar --}}

Uploading files, please wait...

@error('files.*')

{{ $message }}

@enderror
{{-- Selected Files Preview --}} @if(!empty($files))
Selected ({{ count($files) }})
@foreach($files as $file)
{{ $file->getClientOriginalName() }}
{{ number_format($file->getSize() / 1024 / 1024, 2) }} MB
@endforeach {{-- Upload Button --}}
@endif {{-- Upload Guidelines --}}
Max size: {{ $settings['max_file_size_mb'] }}MB
Max files: {{ $this->maxFiles }}
Uploaded: {{ $uploadedAttachments->count() }}
{{-- Upload Progress Indicator --}} @if($uploading)
Uploading files...
Please wait while your files are being uploaded
@endif
@elseif(!$settings['enabled'])

Attachments Disabled

File attachments are disabled for this department.

@else

Attachment Limit Reached

Maximum number of attachments ({{ $this->maxFiles }}) has been reached for this ticket.

@endif {{-- Existing Attachments List --}} @if($uploadedAttachments->count() > 0)
{{-- Section Header --}}

Uploaded Files

{{ $uploadedAttachments->count() }} file{{ $uploadedAttachments->count() > 1 ? 's' : '' }} attached to this ticket

@foreach($uploadedAttachments as $attachment)
{{-- File Icon/Thumbnail --}} @if($attachment->isImage() && $attachment->thumbnail_path) {{ $attachment->original_filename }} @else
@if($attachment->isPdf()) @elseif($attachment->isImage()) @elseif($attachment->isVideo()) @else @endif
@endif {{-- File Info --}}
{{ $attachment->original_filename }}
{{ $attachment->formatted_size }} {{ $attachment->created_at->diffForHumans() }} @if($attachment->download_count > 0) {{ $attachment->download_count }} downloads @endif
{{-- Virus Scan Status --}} @if($attachment->needsVirusScan()) Scanning... @elseif(!$attachment->isSafe()) Virus detected @elseif($attachment->virus_scanned) Safe @endif
{{-- Actions --}}
{{-- Download Button --}} @if($attachment->isSafe()) @endif {{-- Delete Button --}} @can('delete', $attachment) @endcan
@endforeach
@endif {{-- Storage Quota Info (for customers) --}} @if(!auth()->user()->hasAnyRole(['superadmin', 'admin', 'employee'])) @php $quotaMb = auth()->user()->storage_quota_mb ?? $settings['storage_quota_mb'] ?? 100; $usedMb = round(auth()->user()->storage_used_bytes / 1024 / 1024, 2); $percentUsed = ($usedMb / $quotaMb) * 100; @endphp

Storage Usage

{{ $usedMb }}MB of {{ $quotaMb }}MB used

{{ number_format($percentUsed, 0) }}%
capacity
{{-- Progress Bar --}}
@if($percentUsed > 90)

Low storage space

Please delete some files to free up space.

@elseif($percentUsed > 75)

You're approaching your storage limit. Consider deleting old attachments.

@endif
@endif