@if(session()->has('document-upload-error')) @else
{{ $this->name }} @if($isRequired)*@endif
{{-- Show upload form when no file is uploaded --}} @if (empty($this->documents[$this->document_id]['path']))
Allowed: {{ $this->fileType === 'image' ? 'JPG, JPEG, PNG' : ($this->fileType === 'pdf' ? 'PDF' : 'PDF, JPG, JPEG, PNG') }} | Max size: {{ $this->maxSizeKB }} KB @if(($this->fileType === 'image' || $this->fileType === 'pdf-or-image') && $this->validateDimensions) | Dimensions: @if($this->width && $this->height) {{ $this->width }}x{{ $this->height }}px @endif @endif
@error('file')
{{ $message }}
@enderror
{{-- Preview for selected images only --}} @if ($file && in_array(strtolower($file->getClientOriginalExtension()), ['jpg','jpeg','png']))
Preview
@endif {{-- PDF icon preview --}} @if ($file && strtolower($file->getClientOriginalExtension()) === 'pdf')
@endif
@if ($file) @endif
@else {{-- Show uploaded file info with preview --}}
{{-- Thumbnail preview --}} @php $previewPath = $this->documents[$this->document_id]['path']; $previewExtension = strtolower(pathinfo($previewPath, PATHINFO_EXTENSION)); $previewIsImage = in_array($previewExtension, ['jpg','jpeg','png']); $previewFile = urlencode( Crypt::encryptString( Str::after($previewPath, 'public/') ) ); @endphp @if($previewIsImage)
{{ $this->name }}
@else @endif {{ $this->documents[$this->document_id]['file_name'] }} @if($this->documents[$this->document_id]['is_delete']) @endif
@endif {{-- Old Attachments --}} @if (!empty($oldAttachments[$document_id]) && count($oldAttachments[$document_id]) > 0) @if ($showOldAttachment) @endif @endif @endif