@php use App\Services\CertificateTypeProfileService; $positions = $positions ?? \App\Models\CertificateTemplate::defaultFieldPositions(); $typeCode = $typeCode ?? 'participation'; $renderAllFields = $renderAllFields ?? false; $activeFields = CertificateTypeProfileService::requiredFields($typeCode); $nameOrder = $positions['name_order'] ?? ['first_name', 'other_name', 'last_name']; $nameLabels = [ 'first_name' => 'First Name', 'other_name' => 'Other Name', 'last_name' => 'Last Name', ]; $showConference = (bool) ($positions['show_conference'] ?? false); $showCertNo = (bool) ($positions['show_cert_no'] ?? false); $fieldsToRender = $renderAllFields ? array_keys(CertificateTypeProfileService::FIELD_DEFINITIONS) : $activeFields; @endphp @foreach($fieldsToRender as $fieldKey) @php $field = CertificateTypeProfileService::field($fieldKey); $isActive = in_array($fieldKey, $activeFields, true); $hiddenClass = ($renderAllFields && ! $isActive) ? 'd-none' : ''; @endphp @if($fieldKey === 'qr')

QR Code (required)
@else @php $sectionLabel = $fieldKey === 'name' ? CertificateTypeProfileService::nameLabel($typeCode).' (required)' : ($field['label'] ?? ucfirst($fieldKey)).' (required)'; @endphp

{{ $sectionLabel }}
@if($fieldKey === 'name')
@unless(array_key_exists('silentha', \App\Services\CertificateFontService::available()))
Place Silentha.ttf in public/fonts/certificates/ to enable Silentha.
@endunless

Name Order

Choose the sequence for displaying the name.

@foreach([0, 1, 2] as $slot) @php $selected = $nameOrder[$slot] ?? ''; @endphp
@endforeach
@endif @endif @endforeach

Optional fields

Enable only if these details are not already printed on your template artwork.

{{ CertificateTypeProfileService::hint($typeCode) }}