{{-- Attachments Gallery — View Mode with Alpine.js Modal for Forms --}} @php $record = $getRecord(); $attachments = $record ? $record->attachments : collect(); @endphp
{{-- ===== Modal ===== --}}
{{-- Backdrop --}}
{{-- Modal Box --}}
{{-- Header --}}
{{-- Content --}}
{{-- Footer --}}
تحميل
{{-- ===== Files List ===== --}} @if($attachments && $attachments->count())
@foreach($attachments as $attachment) @php $isImage = str_contains($attachment->file_type ?? '', 'image'); $isPdf = str_contains($attachment->file_type ?? '', 'pdf'); $url = asset('storage/' . $attachment->file_path); $name = $attachment->original_name ?? basename($attachment->file_path); $sizeKb = $attachment->file_size ? number_format($attachment->file_size / 1024, 2) . ' KB' : ''; $type = $isImage ? 'image' : 'pdf'; @endphp
{{-- Thumbnail --}}
@if($isImage) {{ $name }} @elseif($isPdf)
@else
@endif
{{-- Name & Size --}}

{{ $name }}

@if($sizeKb)

{{ $sizeKb }}

@endif
{{-- Preview Button --}}
@endforeach
@else

لا توجد ملفات مرفقة لهذا النشاط

@endif