@php if (!function_exists('getChunks')) { function getChunks($data, $size) { return array_chunk($data, $size); } } @endphp @foreach(getChunks($milestoneReport['progressData'] ?? [], 1) as $chunkIndex => $chunk) @php $isFirst = $chunkIndex === 0; $isLast = $chunkIndex === count(getChunks($milestoneReport['progressData'] ?? [], 1)) - 1; @endphp @if(!$isFirst)
@endif
{{-- Header and Learner Info --}} @if($isFirst)

Progress Review

Academic Term 2024-2025

Learner’s Name: {{ $milestoneReport['student']['name'] ?? '' }}

{{ $milestoneReport['ageString'] ?? '' }}

Grade: {{ $milestoneReport['student']->classSection->name ?? '' }}

Attendance: {{ $milestoneReport['totalDaysPresent'] ?? '' }} Out Of {{ $milestoneReport['totalWorkingDays'] ?? '' }}

Facilitators: @foreach($milestoneReport['classSectionTeacher'] ?? [] as $i => $teacher) {{ $teacher['name'] }}@if($i + 1 < count($milestoneReport['classSectionTeacher'])){{ ', ' }}@endif @endforeach

Date: {{ $milestoneReport['currentDate'] ?? '' }}

  • Progress key:

  • @foreach($milestoneReport['progressKeys'] ?? [] as $key)
  • {{ $key['name'] }}
  • @endforeach
@endif {{-- Domain + Subdomain Sections --}}
@foreach($chunk as $domain)

{{ $domain['name'] }}

@foreach($domain['sub_domains'] ?? [] as $subdomain)

{{ $subdomain['name'] }}

@php $strands = $subdomain['strands'] ?? []; $maxStrandCount = $domain['maxStrandCount'] ?? count($strands); $strands = array_pad($strands, $maxStrandCount, null); @endphp @foreach($strands as $strand) @endforeach
{{ $strand['strand'] ?? '' }} @if(!empty($strand)) @endif
@endforeach
@endforeach
{{-- Custom Text Box --}} @if($isLast && trim($milestoneReport['customTextBox']['title'] ?? '') && trim($milestoneReport['customTextBox']['value'] ?? ''))

{{ $milestoneReport['customTextBox']['title'] }}

{{ $milestoneReport['customTextBox']['value'] }}
@endif
@endforeach