@foreach ($quickReply->files as $file)
@php
if (!Storage::exists($file->path)) {
continue;
}
$filePath = $imgSrc = 'storage/' . $file->path;
$mime = mime_content_type($filePath);
if (in_array($mime, ['audio/aac', 'audio/mp4', 'audio/mpeg', 'audio/amr', 'audio/ogg'])) {
$imgSrc = 'assets/icons/feather/mic.svg';
} elseif (in_array($mime, ['text/plain', 'application/pdf', 'application/vnd.ms-powerpoint',
'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/msword', 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])) {
$imgSrc = 'assets/icons/feather/file-text.svg';
} elseif (in_array($mime, ['video/mp4', 'video/3gp'])) {
$imgSrc = 'assets/icons/feather/video.svg';
}
@endphp
@endforeach
@endif
@if ($quickReply->message)