@extends('layouts.app') @section('title', 'View All Leave Requests') @section('content')

All Leave Requests

Note: You have view-only access to all leave requests. Approval is handled by Assistant Directors at appropriate levels.

@foreach(['pending', 'forwarded', 'approved', 'rejected'] as $status) {{ ucfirst($status) }} @endforeach
@if ($leaves->count() > 0)
@foreach ($leaves as $leave) @endforeach
Student Name Roll Number Leave Type Days From Date To Date Status Current Level Action
{{ $leave->student->user->name ?? '-' }} {{ $leave->student->roll_no ?? '-' }} {{ $leave->leave_type_label }} {{ $leave->number_of_days }} {{ $leave->from_date ? $leave->from_date->format('d M Y') : '-' }} {{ $leave->to_date ? $leave->to_date->format('d M Y') : '-' }} {{ ucfirst($leave->status) }} @php $currentApproval = $leave->approvalLogs->where('level', $leave->current_level)->first(); @endphp @if ($currentApproval && $currentApproval->approver)
{{ $currentApproval->approver->name }}
{{ ucfirst(str_replace('_', ' ', $currentApproval->approver->role)) }}
@else ⏳ Pending @endif
View
{{ $leaves->links() }}
@else

No leave requests found.

@endif
@endsection