@foreach($cards as $idx => $c) @php $reg = $c['reg'] ?? null; $student = $reg?->student; $group = $reg?->group; $session = $reg?->session; $fillupItem = $c['fillup_item'] ?? null; $mainSubjects = $c['main_subjects'] ?? []; $mainSubjects = is_array($mainSubjects) ? $mainSubjects : []; $fourthSubjects = $c['fourth_subjects'] ?? []; $fourthSubjects = is_array($fourthSubjects) ? $fourthSubjects : []; $total = count($mainSubjects); $mid = (int) ceil($total / 2); $left = array_slice($mainSubjects, 0, $mid); $right = array_slice($mainSubjects, $mid); $logoPath = $schoolInfo?->school_logo ? asset('core/storage/app/public/' . $schoolInfo->school_logo) : ''; $photoPath = $student?->student_photo ? asset('core/storage/app/public/' . $student->student_photo) : ''; $principalName = $schoolInfo?->principal_name ?? 'Principal'; $principalSignaturePath = $schoolInfo?->principal_signature ? asset('core/storage/app/public/' . $schoolInfo->principal_signature) : ''; $displayRoll = $fillupItem?->class_roll ?? $reg?->class_roll ?? ''; $displayRegNo = $fillupItem?->reg_no ?? ''; $displayBoardRoll = $fillupItem?->board_roll ?? ''; @endphp

{{ $schoolInfo?->school_name ?? 'SCHOOL NAME' }}

{{ $exam->exam_name }} - {{ $session?->name ?? ($exam->session->name ?? '') }}
ADMIT CARD
Student's Name : {{ $student?->student_name_english ?? '' }}
Father's Name : {{ $student?->father_name_english ?? '' }}
Mother's Name : {{ $student?->mother_name_english ?? '' }}
Class : {{ $exam->class->name ?? '' }}
Section : {{ $reg?->section?->name ?? '' }}   Gender: {{ $student?->gender ?? '' }}   Group: {{ $group?->name ?? '' }}
Roll : {{ $displayRoll }}
Registration : {{ $displayRegNo }}
Board Roll : {{ $displayBoardRoll }}
Exam : {{ $exam->exam_name }}
Session : {{ $session?->name ?? ($exam->session->name ?? '') }}
Status : Approved
Subject Code and Name
@php $rows = max(count($left), count($right)); @endphp @if($rows > 0) @for($r = 0; $r < $rows; $r++) @endfor @else @endif
Code - Name Code - Name
@if(isset($left[$r])) {{ $left[$r]['code'] ?? '' }} - {{ $left[$r]['name'] ?? '' }} @endif @if(isset($right[$r])) {{ $right[$r]['code'] ?? '' }} - {{ $right[$r]['name'] ?? '' }} @endif
No subject found from form fill-up.
@if(count($fourthSubjects) > 0)
4th Subject
@foreach($fourthSubjects as $sub) @endforeach
Code - Name
{{ $sub['code'] ?? '' }} - {{ $sub['name'] ?? '' }}
@endif
Directions:
  1. The examinee must bring the Admit Card in the examination hall.
  2. The examinee must sign attendance sheet for each subject.
@if($principalSignaturePath) Principal Signature @endif
{{ $principalName }}
Principal
{{ $schoolInfo?->school_name ?? '' }}
{{-- line between 2 admit cards on the same page --}} @if(($idx + 1) % 2 == 1 && !$loop->last)
@endif {{-- page break after every 2 cards --}} @if(($idx + 1) % 2 == 0 && !$loop->last)
@endif @endforeach