Attachments
@if ($attachments->isNotEmpty())
@foreach ($attachments as $index => $attachment) @php $isImage = str_starts_with($attachment->mime_type ?? '', 'image/'); $thumbUrl = $isImage ? asset('storage/' . $attachment->file_path) : null; $fileUrl = $isImage ? $thumbUrl : route('attachments.download', $attachment); @endphp
@if ($isImage) {{ $attachment->file_name }} @else
{{ strtoupper(pathinfo($attachment->file_name, PATHINFO_EXTENSION) ?: 'FILE') }}
@endif
{{ $attachment->file_name }} @if (! empty($attachment->file_size))
{{ number_format($attachment->file_size / 1024, 1) }} KB
@endif
@if (! empty($deletePermission) && auth()->user()?->can($deletePermission))
@csrf @method('delete')
@endif
@endforeach
@else — @endif