My Leaves

@if(empty($noShift)) Apply for Leave @endif
{{-- No Shift Warning --}} @if(!empty($noShift))
No Shift Assigned
You do not have an active shift assigned yet. Please contact your administrator to get a shift assigned before applying for leave.
@else {{-- Monthly Leave Balance Overview --}} @if(!empty($leaveBalances) && count($leaveBalances) > 0)
@foreach($leaveBalances as $balance)
{{ $balance->leaveType->name ?? 'Unknown' }} @if($balance->leaveType && $balance->leaveType->code) {{ $balance->leaveType->code }} @endif
{{ number_format($balance->remaining, 1) }}
{{ $balance->used_this_month }} used of {{ $balance->monthly_limit }} days/month
@endforeach
@endif {{-- Filter Tabs --}}
All({{ $stats['total'] ?? 0 }}) Pending({{ $stats['new'] ?? 0 }}) Approved({{ $stats['approved'] ?? 0 }}) Rejected({{ $stats['rejected'] ?? 0 }})
{{-- Leaves List --}} @if(isset($leaves) && $leaves->count() > 0)
@foreach($leaves as $leave)
{{ $leave->leaveType->name ?? 'Leave' }} @if($leave->leaveType && $leave->leaveType->code) ({{ $leave->leaveType->code }}) @endif
{{ ucfirst($leave->status) }}
Duration
{{ $leave->from_date->format('d M Y') }} @if($leave->from_date->ne($leave->to_date)) - {{ $leave->to_date->format('d M Y') }} @endif
Days
{{ $leave->number_of_days }} day(s)
@if($leave->approver)
{{ $leave->status == 'approved' ? 'Approved By' : 'Processed By' }}
{{ $leave->approver->first_name ?? '' }} {{ $leave->approver->last_name ?? '' }}
@endif
@if($leave->reason || $leave->created_at) @endif
@endforeach
{{-- Pagination --}} @if($leaves->hasPages())
{{ $leaves->links() }}
@endif @else
No Leave Applications
You haven't applied for any leave yet.
Apply for Leave
@endif @endif {{-- End noShift check --}}