@extends('template.layouts.template-base') @section('title', 'View Driver') @section('content')

Driver Information

Address

Documents

@php $docFiles = []; $docNames = []; if (!empty($driver->vehicle_image)) { $docFiles[] = $driver->vehicle_image; $docNames[] = 'Profile Image'; } if (!empty($driver->license_document)) { $docFiles[] = $driver->license_document; $docNames[] = 'License Document'; } if (!empty($driver->aadhar_document)) { $docFiles[] = $driver->aadhar_document; $docNames[] = 'Aadhar Document'; } @endphp
@forelse ($docFiles as $index => $file) @php $filePath = asset($file); $extension = strtolower(pathinfo($filePath, PATHINFO_EXTENSION)); $viewable = in_array($extension, ['jpg', 'jpeg', 'png', 'pdf', 'html', 'htm', 'gif', 'webp']); $name = $docNames[$index] ?? 'Document ' . ($index + 1); @endphp @empty @endforelse
Document Name Action
{{ $name }} @if ($viewable) View @else Download @endif
No documents uploaded
Back Edit
@include('template.layouts.error-modal') @endsection