@extends('index') @section('content')

Heads Table

@if($head->count()) @foreach($head as $item) @endforeach @endif
Sr. Head Type Head Status Action
{{$loop->index + 1}} {{$item->htname}} {{$item->name}} @if($item->head_status) Active @else Inactive @endif
@foreach($headType as $ht)
@php $filteredHeads = $head->filter(function($item) use ($ht) { return $item->head_type_id == $ht->head_type_id; }); @endphp @if($filteredHeads->count()) @foreach($filteredHeads as $item) @endforeach @else @endif
Sr. Head Status Action
{{$loop->index + 1}} {{$item->name}} @if($item->head_status) Active @else Inactive @endif
No heads available for this type
@endforeach
@if($head->count()) @foreach($head as $item) @endforeach @endif @endsection