@php
$uCard = auth()->user();
$pCard = optional($uCard->profile);
$provinceCard = optional($pCard->province)->name ?? ($pCard->other_province ?? null);
@endphp
{{ $activity->name ?? 'Sertifikat PESERTA' }}
{{ auth()->user()->name ?? '-' }}
{{ $uCard->email ?? '-' }}
{{ $pCard->no_hp ?? '-' }}
{{ $pCard->jenis_kelamin ?? '-' }}
{{ $pCard->pekerjaan ?? '-' }}
{{ $pCard->jabatan ?? '-' }}
{{ $pCard->alamat ?? '-' }}
{{ $provinceCard ?? '-' }}
{{ $currentCertificateId ?? '-' }}
@if(auth()->user()->profile && auth()->user()->profile->foto)
@php
$photoPath = auth()->user()->profile->foto;
$publicPath = asset('assets/images/profilefoto/' . $photoPath);
@endphp

@else
 }})
@endif
@php
$qrLink = route('activity.download-certificate', ['id' => $activity->id]) . '?show_certificate=1';
try {
$qrPng = \SimpleSoftwareIO\QrCode\Facades\QrCode::format('png')->size(80)->generate((string) $qrLink);
$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) $qrLink);
}
@endphp