@foreach($iscategories as $index => $category)
@if($index < 3)
@elseif($index === 3)
@else
@endif
@endforeach
@if(count($iscategories) > 3)
@endif
@foreach($iscategories as $index => $category)
@php
// Get all checklists under this main category (including its subcategories)
$categoryIds = collect($category->children)->pluck('id')->push($category->id)->toArray();
$categoryChecklists = $checklists->whereIn('category_id', $categoryIds);
@endphp
@if($categoryChecklists->count() > 0)
#
Questionnaire
Answer
Control Ref
Standard
Evidence
Category
Status
Remarks
Action
@foreach($categoryChecklists as $index2 => $item)
{{ $index2 + 1 }}
{{ $item->assessment_questionnaire }}
{{ $item->answer ?? '-' }}
{{ $item->control_reference_number ?? '-' }}
{{ $item->iso_standard ?? '-' }}
{{ $item->evidence ?? '-' }}
{{ $item->category->name ?? '-' }}
{{ $item->status ?? '-' }}
{{ $item->remarks ?? '-' }}
Edit Checklist
@endforeach
@else
No checklist items found under {{ $category->name }}.