@php $promotionDateFormatted = $promotionDate ? $promotionDate->format('F j, Y') : '—'; $testingDateFormatted = $testingDate ? $testingDate->format('M j, Y') : '—'; $registrationDateFormatted = $registrationDate ? $registrationDate->format('M j, Y') : '—'; $certificateNumber = 'RP-' . str_pad((string) $promotionId, 6, '0', STR_PAD_LEFT); $academyContact = $academyContact ?? []; $website = $academyContact['website'] ?? config('app.url'); $contactParts = collect($academyContact)->except('website')->filter(fn ($value) => filled($value))->values(); $academyInitials = collect(preg_split('/\s+/', trim($academyName)))->filter()->take(2)->map(fn ($word) => mb_strtoupper(mb_substr($word, 0, 1)))->implode(''); $certificateSettings = $certificateSettings ?? \App\Models\RankPromotionCertificateSetting::defaults(); $certificateImages = $certificateImages ?? []; $lengthClass = fn ($value, $longAt, $veryLongAt = null) => mb_strlen((string) $value) > ($veryLongAt ?? PHP_INT_MAX) ? ' very-long' : (mb_strlen((string) $value) > $longAt ? ' long' : ''); @endphp
@if($logoPath) @else
{{ $academyInitials ?: 'MA' }}
@endif
{{ $academyName }}
{{ $certificateSettings->resolved('header_kicker') }}
@if($certificateImages['rank_honor_image'] ?? null) Rank honor @endif
{{ $certificateSettings->resolved('certificate_title') }}
{{ $certificateSettings->resolved('certificate_subtitle') }}
{{ $certificateSettings->resolved('recipient_introduction') }}
{{ $studentName }}
{{ $certificateSettings->resolved('certificate_description') }}
@if($previousRank)
Previous Rank
{{ $previousRank }}
@else
Rank Advancement
Earned
@endif
{{ $newRank }}
@if($rankStyle)
{{ $rankStyle }}
@endif
@if($certificateImages['official_certification_image'] ?? null) Official rank certification @endif
Promotion Date
{{ $promotionDateFormatted }}
Testing Date
{{ $testingDateFormatted }}
Registered
{{ $registrationDateFormatted }}
Testing Event
{{ $testingEvent ?: '—' }}
Academy / Location
{{ $locationName ?: '—' }}
Instructor
{{ $instructorName ?: '—' }}
Authorized By
{{ $promotedBy ?: '—' }}
@if($certificateImages['instructor_image'] ?? null)Instructor@endif
{{ $instructorName ?: '—' }}
Instructor
@if($certificateImages['authorized_representative_image'] ?? null)Authorized representative@endif
{{ $promotedBy ?: '—' }}
Head Instructor / Authorized Representative