@extends('layouts.admin') @section('title', 'Leaves') @php $statusClass = ['pending' => 'warning', 'approved' => 'success', 'rejected' => 'danger']; @endphp @section('content')
Leave Management @if ($pendingCount) {{ $pendingCount }} awaiting approval @endif
@foreach (['' => 'All', 'pending' => 'Pending', 'approved' => 'Approved', 'rejected' => 'Rejected'] as $key => $label) {{ $label }} @endforeach
Add
@if ($items->isEmpty())

No leave records match this filter.

@else
@foreach ($items as $item) @endforeach
Employee Type From To Days Reason Status Action
{{ $item->employee?->name }} {{ $item->leave_type }} {{ optional($item->from_date)->format('d M Y') }} {{ optional($item->to_date)->format('d M Y') }} {{ $item->days }} {{ \Illuminate\Support\Str::limit($item->reason, 70) }} {{ ucfirst($item->status) }} @if ($item->reviewed_at)
by {{ $item->reviewer?->name ?? 'Admin' }}
{{ $item->reviewed_at->format('d M Y') }}
@endif
@if ($item->isPending()) @endif View Edit
@endif
@foreach ($items->where('status', 'pending') as $item) @endforeach @endsection @push('scripts') @endpush