{{-- PDF generators like DomPDF can't load external URLs directly they need either local file paths or base64-encoded images. --}} @if($student->image) @php $imageUrl = env('VITE_EXTERNAL_APP_URL') . '/storage/' . $student->image; $imageData = @file_get_contents($imageUrl); if ($imageData !== false) { $base64 = base64_encode($imageData); $mimeType = finfo_buffer(finfo_open(), $imageData, FILEINFO_MIME_TYPE); $imageSrc = 'data:' . $mimeType . ';base64,' . $base64; } else { $imageSrc = null; } @endphp @if(isset($imageSrc) && $imageSrc) {{ $student->full_name }} @else
@endif @else
@endif
STUDENT NAME: {{ $student->full_name }}
STUDENT ID: {{ $student->id }}
D.O.B: {{ $student->birthdate->format('m/d/Y') }}