@php $types = ['present' => 'Present', 'late' => 'Late', 'absent' => 'Absent', 'holiday' => 'Holiday']; @endphp @forelse ($employees as $i => $item) @php // IMPORTANT: use the selected date, not today() $attandance = getAttandanceData($item->id, $selectedDate); @endphp {{-- hidden employee id for aligned indexes --}} {{ $i + 1 }} {{ $item->employee_id }} {{ $item->name }} - {{ $item->employee_id }} @foreach ($types as $value => $label)
@endforeach @empty No employees found for this filter. @endforelse