@php use App\Models\SchoolSetting; use Illuminate\Support\Facades\Storage; $student = $admitCard->student; $exam = $admitCard->exam; $schoolName = SchoolSetting::get('school_name', ''); $schoolAddress = SchoolSetting::get('school_address', ''); $schoolEstablishedYear = SchoolSetting::get('school_established_year', ''); $schoolAddressLine = collect([ $schoolAddress, $schoolEstablishedYear ? "Established: {$schoolEstablishedYear}" : null, ])->filter()->implode(' | '); $footerText = SchoolSetting::get('admit_card_footer_text', ''); $toDataUri = function (?string $path): ?string { if (!$path) { return null; } $disk = Storage::disk('public'); if (!$disk->exists($path)) { return null; } $mime = $disk->mimeType($path) ?: 'image/png'; return 'data:' . $mime . ';base64,' . base64_encode($disk->get($path)); }; $sealDataUri = $toDataUri(SchoolSetting::get('school_seal')); $signatureDataUri = $toDataUri(SchoolSetting::get('principal_signature')); $studentPhotoDataUri = $toDataUri($student->user?->avatar); @endphp
| Student Name | {{ $student->user?->name }} | ||
| Class | {{ $student->class?->name }} | Roll No | {{ sprintf('%02d', $student->roll_no) }} |
| Group | {{ $student->group?->name }} | Section | {{ $student->section?->name }} |
| Group | {{ $student->group?->name }} | ||
| Section | {{ $student->section?->name }} | ||
| Exam | {{ $exam->examType?->name }} {{" - "}} {{ $exam->session_year }} | ||
| Exam Period | {{ $exam->start_date?->format('d M Y') }} to {{ $exam->end_date?->format('d M Y') }} | ||
|
@if ($sealDataUri)
@endif School Seal |
@if ($signatureDataUri)
@endif Principal's Signature |