@php $ext = strtolower(pathinfo($file->file_name ?? $file->name, PATHINFO_EXTENSION)); $icon = 'ri-file-3-line'; if($ext === 'pdf') $icon = 'ri-file-pdf-line text-danger'; elseif(in_array($ext, ['doc','docx'])) $icon = 'ri-file-word-line text-primary'; elseif(in_array($ext, ['xls','xlsx'])) $icon = 'ri-file-excel-line text-success'; elseif(in_array($ext, ['ppt','pptx'])) $icon = 'ri-file-ppt-line text-warning'; elseif(in_array($ext, ['jpg','jpeg','png','gif'])) $icon = 'ri-image-line text-info'; @endphp