@extends('admin.admin_dashboard') @section('admin')
{{-- Breadcrumb --}} {{-- Statistics Cards --}}

{{ $statistics['total'] }}

Total Applications

{{ $statistics['pending'] }}

Pending

{{ $statistics['approved'] }}

Approved

{{ $statistics['rejected'] }}

Rejected

{{-- Filter Box --}}
Filter
{{-- List Box --}}
Leave Applications List
@forelse($leaves as $key => $leave) @php $fromDate = \Carbon\Carbon::parse($leave->from_date); $toDate = \Carbon\Carbon::parse($leave->to_date); $totalDays = $fromDate->diffInDays($toDate) + 1; $statusColors = [ 'pending' => 'warning', 'approved' => 'success', 'rejected' => 'danger', 'cancelled' => 'secondary' ]; $statusColor = $statusColors[$leave->status] ?? 'info'; @endphp @empty @endforelse
S.No Employee Leave Type From Date To Date Days Status Applied On Actions
{{ $leaves->firstItem() + $key }} {{ $leave->employee->name ?? 'N/A' }}
{{ $leave->employee->e_id ?? '' }}
{{ ucfirst($leave->leave_type) }} {{ $fromDate->format('d M Y') }} {{ $toDate->format('d M Y') }} {{ $totalDays }} day{{ $totalDays > 1 ? 's' : '' }} {{ ucfirst($leave->status) }} {{ $leave->created_at->format('d M Y') }} @if($leave->status === 'pending') @canAny(['Admin','Approve Leave', 'Reject Leave'])
@csrf
@csrf
@endcanAny @endif
No leave applications found.
{{-- Pagination --}} @if($leaves->hasPages())
Showing {{ $leaves->firstItem() }} to {{ $leaves->lastItem() }} of {{ $leaves->total() }} entries
{{ $leaves->links() }}
@endif
@endsection