@if($document->front_side_path)
@php $frontType = pathinfo($document->front_image, PATHINFO_EXTENSION); $isImage = in_array(strtolower($frontType), ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']); $isPdf = strtolower($frontType) === 'pdf'; @endphp @if($isImage) Document @elseif($isPdf) @else @endif
@endif @if($document->back_side_path)
@php $backType = pathinfo($document->back_image, PATHINFO_EXTENSION); $isImage = in_array(strtolower($backType), ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']); $isPdf = strtolower($backType) === 'pdf'; @endphp @if($isImage) Document @elseif($isPdf) @else @endif
@endif
@if($document->front_image && $document->back_image) @endif