{{-- resources/views/toilets/index.blade.php --}} Certificates Certificates @can('certificate.create')
@csrf
@endcan
@foreach ($certificates as $index => $certificate)
@can('certificate.delete')
@endcan
#{{ $index + 1 }}
@php $ext = pathinfo($certificate->file, PATHINFO_EXTENSION); $fileUrl = asset('storage/' . $certificate->file); @endphp @if (in_array(strtolower($ext), ['jpg', 'jpeg', 'png', 'gif'])) file @elseif(strtolower($ext) === 'pdf')

PDF cannot be displayed. Download PDF

@else @endif
@endforeach
{{-- Add --}}