@php $first = $month->copy()->startOfMonth(); $lead = ($first->dayOfWeek + 6) % 7; $dayKeys = array_keys($days); @endphp {{ $month->copy()->subMonth()->format('M') }} {{ $month->copy()->addMonth()->format('M') }}
This month
@foreach (['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] as $label)
{{ $label }}
@endforeach @for ($i = 0; $i < $lead; $i++)
@endfor @foreach ($dayKeys as $key) @php $day = \Illuminate\Support\Carbon::parse($key); $onLeave = $days[$key]; @endphp
{{ $day->day }} @if ($onLeave->isNotEmpty()) {{ $onLeave->count() }} @endif
@foreach ($onLeave->take(3) as $leave)
{{ $leave->user?->name }} ยท {{ $leave->leaveType?->name }}
@endforeach @if ($onLeave->count() > 3)

+{{ $onLeave->count() - 3 }} more

@endif
@endforeach
@if ($leaves->isEmpty())

No approved leave overlaps {{ $month->format('F Y') }}.

@else
@foreach ($leaves->sortBy('start_date') as $leave) @endforeach
Staff Department Type From To Days
{{ $leave->user?->name }} {{ $leave->user?->department?->name ?? 'โ€”' }} {{ $leave->leaveType?->name }} {{ $leave->start_date->format('d M Y') }} {{ $leave->end_date->format('d M Y') }} {{ number_format((float) $leave->days, 1) }}
@endif