@foreach($participants as $participant) @php $userParticipant = optional($participant)->user; if (!$userParticipant) continue; $profileParticipant = optional($userParticipant->profile); // Card dimensions $widthCm = data_get($cardSetting, 'card.width_cm', 8.6); $heightCm = data_get($cardSetting, 'card.height_cm', 5.4); // Background $bgFilename = data_get($cardSetting, 'card.background'); $bgUrl = $bgFilename ? asset('assets/images/card/' . $bgFilename) : ''; // Styles $titleStyle = data_get($cardSetting, 'title', []); $photoStyle = data_get($cardSetting, 'photo', []); $qrStyle = data_get($cardSetting, 'qr', []); $nameStyle = data_get($cardSetting, 'name', []); // Photo $photoFilename = optional($profileParticipant)->foto; $photoUrl = $photoFilename ? asset('assets/images/profilefoto/' . $photoFilename) : asset('assets/images/profilefoto/default-profile.png'); $photoShape = data_get($photoStyle, 'shape', 'square'); // QR Code $qrSize = data_get($qrStyle, 'size', 80); $qrData = $userParticipant->id ?? 0; $qrSvg = \SimpleSoftwareIO\QrCode\Facades\QrCode::size($qrSize)->generate($qrData); $qrBase64 = base64_encode($qrSvg); @endphp
{{-- Title --}} @if(data_get($titleStyle, 'visible', true))
{{ $activity->name ?? 'KARTU PESERTA' }}
@endif {{-- Photo --}} @if(data_get($photoStyle, 'visible', true))
{{ $userParticipant->name }}
@endif {{-- Name --}} @if(data_get($nameStyle, 'visible', true))
{{ $userParticipant->name ?? '-' }}
@endif {{-- QR Code --}} @if(data_get($qrStyle, 'visible', true))
QR Code
@endif
@endforeach