@php $layout = strtolower(auth()->user()->role) === 'admin' ? 'layouts.admin' : 'layouts.manager'; @endphp @extends($layout) @section('header')

Monthly Leave Report

@endsection @section('content')
@php $totalLeaves = 0; foreach($leaveData as $leaves) { $totalLeaves += $leaves->count(); } @endphp

Total Leave Requests This Month

{{ $totalLeaves }}

@forelse($leaveData as $userId => $leaves) @foreach($leaves as $leave) @endforeach @empty @endforelse
# Employee No Name Leave Type Start Date End Date Status
{{ $loop->parent->iteration }}.{{ $loop->iteration }} {{ $leave->user->employee?->employee_no ?? 'N/A' }} {{ $leave->user->name }} {{ $leave->leave_type }} {{ $leave->start_date->format('M d, Y') }} {{ $leave->end_date->format('M d, Y') }} @if($leave->status === 'Approved') ✓ Approved @elseif($leave->status === 'Declined') ✗ Declined @else ⏳ Pending @endif
No leave requests found
@endsection