@props([ 'name' => 'files[]', 'id' => 'files', 'multiple' => true, 'maxFileSize' => 10240, 'maxFiles' => 10, 'allowedTypes' => null, 'fileCategories' => [], 'enablePreview' => true, 'enableEdit' => true, 'showFileInfo' => true, 'showGuidelines' => true, 'existingAttachments' => null, 'label' => 'Attachments', 'icon' => 'bi-paperclip', 'required' => false, 'errors' => null, 'class' => '', 'wrapperClass' => 'form-group' ]) @once @push('head') {!! resource('sitemanager::css/file-upload.css') !!} {!! resource('sitemanager::js/file-upload.js') !!} @endpush @endonce
@if($label) @endif

Drag & drop files here or click to browse

Max {{ number_format($maxFileSize) }}KB per file • {{ is_array($allowedTypes) ? implode(', ', $allowedTypes) : $allowedTypes }}
@if($showGuidelines)
Upload Guidelines:
• Max file size: {{ number_format($maxFileSize) }}KB per file
• Max files per upload: {{ $maxFiles }}
• Allowed types: {{ is_array($allowedTypes) ? implode(', ', $allowedTypes) : $allowedTypes }}
@endif
Selected Files:
@if($existingAttachments && $existingAttachments->count() > 0)
Current Attachments:
@foreach($existingAttachments->sortBy('sort_order') as $attachment)
@if($attachment->is_image ?? false) Preview @else @endif
@if($enableEdit)
@if(!empty($fileCategories))
@endif
@else
{{ $attachment->original_name ?? $attachment->name ?? 'Unknown File' }}
@if(isset($attachment->description) && $attachment->description)
{{ $attachment->description }}
@endif @endif @if($showFileInfo)
@if(isset($attachment->original_name)) Original: {{ $attachment->original_name }} @endif @if(isset($attachment->formatted_file_size)) ({{ $attachment->formatted_file_size }}) @elseif(isset($attachment->size)) ({{ number_format($attachment->size / 1024, 1) }}KB) @endif
@endif
@if(isset($attachment->download_url)) @endif
@endforeach
@endif
@if($errors && $errors->has($name))
{{ $errors->first($name) }}
@endif
@once @push('scripts') @endpush @endonce