@foreach ($input['value'] as $value)
@if(!empty($value))
@php
$imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp']; // Add more if needed
$path = $value; // Your file path
// Get the file extension
$extension = pathinfo($value, PATHINFO_EXTENSION);
// Check if the extension is in the list of image extensions
$isImage = in_array(strtolower($extension), $imageExtensions);
$isPdf = $extension =='pdf';
$isMp4 = $extension =='mp4';
$isMp3 = $extension =='mp3';
/* $isDocx=false;
if ($extension == 'docx' or $extension == 'xls' or $extension == 'xlsx' or $extension == 'ppt' or $extension == 'doc' or $extension == 'xls') {
$isDocx = true;
} */
@endphp
{{-- type== image --}}
@if ($input['accept'] != '')
@endif
@if($isImage)
@endif
{{-- @if ($isDocx)
@dump(basename($value))
عرض
@endif --}}
{{-- @if ($isPdf)
عرض
{{ basename($value) }}
@endif
@if($isMp4)
شاهد الفديو
@endif
@if($isMp3)
@endif --}}
{{-- @if(!$isMp3 and !$isImage and !$isMp4 and !$isPdf) --}}
@php
$filePath = str_replace('/', '--', $value);
@endphp
عرض
{{ basename($value) }}
{{-- @endif --}}