@php $school = $student->school; $major = $student->major; $dob = $student->birth_date ? $student->birth_date->format('d M Y') : '-'; $photoUrl = $student->photo_path ? asset('storage/' . $student->photo_path) : null; $logoLeft = $school?->logo_left_path ? asset('storage/' . $school->logo_left_path) : null; $logoRight = $school?->logo_right_path ? asset('storage/' . $school->logo_right_path) : null; $signature = $school?->principal_signature_path ? asset('storage/' . $school->principal_signature_path) : null; $stamp = $school?->principal_stamp_path ? asset('storage/' . $school->principal_stamp_path) : null; $initials = collect(explode(' ', $student->full_name))->filter()->map(fn ($p) => strtoupper(substr($p, 0, 1)))->take(2)->implode(''); $addressParts = array_filter([ $student->address_road, implode(' / ', array_filter([$student->address_rt ? 'RT ' . $student->address_rt : null, $student->address_rw ? 'RW ' . $student->address_rw : null])), $student->address_village, $student->address_district, $student->address_city, $student->address_province, ]); $address = count($addressParts) ? implode(', ', array_filter($addressParts)) : '-'; $validity = $student->grade_level ? 'Masa berlaku sampai kelas ' . $student->grade_level . ' lulus.' : 'Kartu berlaku selama menjadi peserta didik.'; $qrData = $student->full_name . ' | ' . ($student->birth_place ?: '-') . ', ' . $dob . ' | ' . ($student->gender ?: '-') . ' | ' . ($student->religion ?: '-'); @endphp Kartu Pelajar - {{ $student->full_name }} (Template 2)
{{ $school->name ?? 'Nama Sekolah' }}
{{ $school?->address ?? 'Alamat sekolah' }}
@if($photoUrl) Foto {{ $student->full_name }} @else
{{ $initials ?: 'PF' }}
@endif
NIS / NISN {{ $student->nis ?: '-' }} / {{ $student->nisn ?: '-' }}
Identitas Siswa
{{ $student->full_name }}
{{ $major->name ?? 'Jurusan -' }}
Tempat, Tanggal Lahir {{ $student->birth_place ?: '-' }}, {{ $dob }}
Agama {{ $student->religion ?: '-' }}
Alamat {{ $address }}
Data Akademik
Nama Lengkap {{ $student->full_name }}
Jurusan {{ $major->name ?? '-' }}
Wali Kelas {{ $school?->phone ? 'Kontak: ' . $school->phone : '-' }}
Alamat {{ $address }}
TTL {{ $student->birth_place ?: '-' }}, {{ $dob }}
Agama {{ $student->religion ?: '-' }}
QR Validasi
Kepala Sekolah
@if($signature) Tanda tangan {{ $school?->principal_name }} @else
@endif @if($stamp) Stempel @endif
{{ $school?->principal_name ?? 'Nama Kepala Sekolah' }}
Informasi Sekolah
{{ $school->name ?? '-' }}
{{ $school?->address ?? '-' }}
{{ $school?->city ?? '' }} {{ $school?->province ? '• ' . $school->province : '' }}
Telp: {{ $school?->phone ?? '-' }}
Ketentuan Kartu
1. Bawa kartu setiap hari sekolah.
2. Jangan meminjamkan kepada orang lain.
3. Laporkan ke TU jika hilang/rusak untuk cetak ulang.
4. Scan QR untuk verifikasi keaslian.
{{ $validity }} Scan QR untuk validasi keaslian kartu.