@foreach($complaint->files as $file)
@php
$ext = strtolower(pathinfo($file->file_name, PATHINFO_EXTENSION));
$fileUrl = route('secure.file', $file->file_path);
@endphp
{{-- صورة --}}
@if(in_array($ext, ['jpg','jpeg','png','webp']))

{{-- PDF --}}
@elseif($ext == 'pdf')
PDF
{{-- ملفات أخرى --}}
@else
{{ strtoupper($ext) }}
@endif
{{ $file->file_name }}
@endforeach