@foreach($desks as $desk)

{{ $desk->name }}

@for ($i = 1; $i <= \Carbon\Carbon::create($year, $month)->daysInMonth; $i++) @endfor @for ($i = 1; $i <= \Carbon\Carbon::create($year, $month)->daysInMonth; $i++) @endfor @php $attendances = \App\Models\DeskEmployeeAttendance::getAttendanceForDesk($desk->id, $year, $month); @endphp @foreach($desk->employees as $employee) @for ($i = 1; $i <= \Carbon\Carbon::create($year, $month)->daysInMonth; $i++) @php $date = \Carbon\Carbon::createFromDate($year, $month, $i)->format('Y-m-d'); $savedStatus = $attendances[$employee->id . '-' . $date]->status ?? ''; $deleteButton = \App\Models\DeskEmployeeAttendance::showDeleteButton($desk->id, $employee->id, $year, $month); $today = \Carbon\Carbon::today(); $twoDaysPast = $today->subDays(2); $isPastDate = \Carbon\Carbon::createFromFormat('Y-m-d', $date)->lt($twoDaysPast); @endphp @endfor @endforeach
Sl.No Name Phone{{ $i }}
{{ \Carbon\Carbon::createFromDate($year, $month, $i)->format('D') }}
{{ $loop->iteration }} {{ $employee->name }} {{ $employee->mobile_number }}{{ $savedStatus }}@if(!$deleteButton)@endif
@endforeach