@php $type = $cardType; $custom = $customData; $prefix = $type === 'id' ? 'id' : 'visiting'; $sigs = $custom['content']['signatures'] ?? []; $directorSig = $sigs['director'] ?? []; $hrSig = $sigs['hr'] ?? []; $frontOrder = $custom['layout']['order']['front'] ?? \App\Support\CardCustomization::defaultFrontOrder($type); $backOrder = $custom['layout']['order']['back'] ?? \App\Support\CardCustomization::defaultBackOrder($type); $sectionLabels = $type === 'id' ? [ 'show_logo' => __('Organization logo'), 'show_org_motto' => __('Organization motto'), 'show_org_name' => __('Organization name'), 'show_photo' => __('Employee photo'), 'show_name' => __('Employee name'), 'show_designation' => __('Designation'), 'show_signature' => __('Signature block'), 'show_signature_director' => __('Director signature'), 'show_signature_hr' => __('HR signature'), 'show_signature_image' => __('Uploaded signature images'), 'show_phone' => __('Phone (front/meta)'), 'show_email' => __('Email (front/meta)'), 'show_branch' => __('Branch'), 'show_barcode' => __('Barcode strip'), 'show_back_certification' => __('Back: certification text'), 'show_sid' => __('Back: SID'), 'show_nid' => __('Back: NID'), 'show_blood_group' => __('Back: blood group'), 'show_property_note' => __('Back: property note'), 'show_return_address' => __('Back: return address'), 'show_org_contact' => __('Back: org contact'), 'show_issue_date' => __('Back: issue date'), 'show_footer_notice' => __('Back: non-transferable notice'), 'show_back_qr' => __('Back: QR code'), 'show_instructions' => __('Back: custom instructions'), ] : [ 'show_logo' => __('Organization logo'), 'show_org_name' => __('Organization name'), 'show_org_motto' => __('Organization motto'), 'show_branch' => __('Branch tag (front)'), 'show_name' => __('Employee name'), 'show_designation' => __('Designation'), 'show_department' => __('Department'), 'show_phone' => __('Phone'), 'show_email' => __('Email'), 'show_address' => __('Address'), 'show_website' => __('Website'), 'show_qr' => __('QR code'), 'show_sid' => __('Employee SID'), 'show_instructions' => __('Custom instructions'), ]; $directorImg = \App\Support\CardCustomization::signatureImageUrl($custom, 'director'); $hrImg = \App\Support\CardCustomization::signatureImageUrl($custom, 'hr'); $previewRoute = route('admin.card_templates.preview', ['type' => $type, 'template' => $activeTemplateId]); @endphp