@php
$uCard = auth()->user();
$pCard = optional($uCard->profile);
$provinceCard = optional($pCard->province)->name ?? ($pCard->other_province ?? null);
@endphp
@php $titleVisible = data_get($certificateSetting ?? [], 'title.visible', true); @endphp
@if($titleVisible)
{{ $activity->name ?? 'Sertifikat PESERTA' }}
@endif
{{ auth()->user()->name ?? '-' }}
{{ $uCard->email ?? '-' }}
{{ $pCard->no_hp ?? '-' }}
{{ $pCard->jenis_kelamin ?? '-' }}
{{ $pCard->pekerjaan ?? '-' }}
{{ $pCard->jabatan ?? '-' }}
{{ $pCard->alamat ?? '-' }}
{{ $provinceCard ?? '-' }}
@php $photoVisible = data_get($certificateSetting ?? [], 'photo.visible', true); @endphp
@if($photoVisible)
@if(auth()->user()->profile && auth()->user()->profile->foto)
@php
$photoPath = auth()->user()->profile->foto;
$publicPath = asset('assets/images/profilefoto/' . $photoPath);
@endphp

@else
 }})
@endif
@endif
@php
$qrData = $currentCertificateId ?? Auth::user()->id;
try {
$qrPng = \SimpleSoftwareIO\QrCode\Facades\QrCode::format('png')->size(80)->generate((string) $qrData);
$qrBase64 = 'data:image/png;base64,'.base64_encode($qrPng);
} catch (\Throwable $e) {
$qrBase64 = 'https://api.qrserver.com/v1/create-qr-code/?size=80x80&data='.urlencode((string) $qrData);
}
@endphp