{{-- resources/views/components/allegati/file-display.blade.php --}} @props(['files' => []]) @foreach($files as $file) @php $filePath = storage_path('app/public/' . $file); $extension = pathinfo($filePath, PATHINFO_EXTENSION); $allowedExtensions = ['jpg', 'jpeg', 'png', 'gif']; @endphp @if(file_exists($filePath) && in_array(strtolower($extension), $allowedExtensions))
{{ basename($file) }}
@endif @endforeach