Leave Applications

@if(session('success'))
{{ session('success') }}
@endif {{-- Stats --}}
{{ $stats['new'] ?? 0 }}
Pending
{{ $stats['approved'] ?? 0 }}
Approved
{{ $stats['rejected'] ?? 0 }}
Rejected
{{ $stats['total'] ?? 0 }}
Total
{{-- Filters --}}
All Pending Approved Rejected
{{-- Table --}} {{--
@forelse($applications ?? [] as $leave) @empty @endforelse
Staff Leave Type Duration Days Status Applied Handover To Actions
{{ $leave->staff->first_name ?? '' }} {{ $leave->staff->last_name ?? '' }} {{ $leave->leaveType->name ?? 'Leave' }} {{ \Carbon\Carbon::parse($leave->from_date)->format('d M') }} @if(\Carbon\Carbon::parse($leave->from_date)->format('Y-m-d') != \Carbon\Carbon::parse($leave->to_date)->format('Y-m-d')) - {{ \Carbon\Carbon::parse($leave->to_date)->format('d M') }} @endif {{ $leave->number_of_days }} @if($leave->status == 'new') Pending @elseif($leave->status == 'approved') Approved @elseif($leave->status == 'rejected') Rejected @else {{ ucfirst($leave->status) }} @endif {{ $leave->created_at->format('d M Y') }}
@if($leave->status == 'new')
@csrf
@else View @endif
No leave applications found
--}} {{-- Table --}}
@forelse($applications ?? [] as $leave) @empty @endforelse
Staff Leave Type Duration Days Status Applied Notify Handover To Actions
{{ $leave->staff->first_name ?? '' }} {{ $leave->staff->last_name ?? '' }} {{ $leave->leaveType->name ?? 'Leave' }} {{ \Carbon\Carbon::parse($leave->from_date)->format('d M') }} @if(\Carbon\Carbon::parse($leave->from_date)->format('Y-m-d') != \Carbon\Carbon::parse($leave->to_date)->format('Y-m-d')) - {{ \Carbon\Carbon::parse($leave->to_date)->format('d M') }} @endif {{ $leave->number_of_days }} @if($leave->status == 'new') Pending @elseif($leave->status == 'approved') Approved @elseif($leave->status == 'rejected') Rejected @else {{ ucfirst($leave->status) }} @endif {{ $leave->created_at->format('d M Y') }} @if($leave->followers && $leave->followers->count() > 0) {{ $leave->followers->map(fn($f) => $f->first_name . ' ' . $f->last_name)->implode(', ') }} @else @endif @if($leave->handovers && $leave->handovers->count() > 0) {{ $leave->handovers->map(fn($h) => $h->first_name . ' ' . $h->last_name)->implode(', ') }} @else @endif
@if($leave->status == 'new')
@csrf
@else View @endif
No leave applications found
{{-- Pagination --}} @if(isset($applications) && $applications->hasPages())
{{ $applications->links() }}
@endif
{{-- Reject Modal --}}