@foreach($dates as $date) @endforeach @foreach($staffList as $index => $staff) @foreach($dates as $date) @endforeach @endforeach
# Staff ID Name{{ date('d-m-Y', strtotime($date)) }}
{{ $index + 1 }} {{ $staff->staff_id }} {{ $staff->staff_name }} {{ optional(optional($staff->attendance->first()->dayRecords->firstWhere('attendance_date', $date))->status) ?? '-' }}