@php use App\Services\CertificateTypeProfileService; $nameFont = \App\Services\CertificateFontService::resolve($positions['name_font'] ?? null); $requiredFields = CertificateTypeProfileService::requiredFields($typeCode ?? null); $fieldStyles = [ 'name' => ['class' => 'name', 'content' => $content['name'] ?? ($displayName ?? $user->name ?? ''), 'font' => true], 'authors' => ['class' => 'authors', 'content' => $content['authors'] ?? ''], 'paper_title' => ['class' => 'paper-title', 'content' => $content['paper_title'] ?? ''], 'position' => ['class' => 'position', 'content' => $content['position'] ?? ''], 'committee_name' => ['class' => 'committee', 'content' => $content['committee_name'] ?? ''], 'topic' => ['class' => 'topic', 'content' => $content['topic'] ?? ''], ]; @endphp
@if(! empty($templatePath) && file_exists($templatePath)) @endif @foreach($requiredFields as $fieldKey) @if($fieldKey === 'qr') @if(! empty($qrPath) && file_exists($qrPath)) QR @endif @else @php $field = CertificateTypeProfileService::field($fieldKey); $style = $fieldStyles[$fieldKey] ?? null; @endphp @if($field && $style && ($style['content'] ?? '') !== '')
{{ $style['content'] }}
@endif @endif @endforeach @if(\App\Models\CertificateTemplate::showsConference($positions, $typeCode ?? null))
{{ $conference->name ?? '' }} ({{ $conference->conference_year ?? '' }})
@endif @if(\App\Models\CertificateTemplate::showsCertificateNumber($positions, $typeCode ?? null))
Certificate No: {{ $certificateNumber }}
@endif