@extends('layouts.admin') @section('title', 'My Leave') @php $statusClass = ['pending' => 'warning', 'approved' => 'success', 'rejected' => 'danger']; @endphp @section('content') @if (! $employee)
No employee profile linked. Your login is not connected to an active employee record, so you cannot apply for leave yet. Ask an administrator to link your account from HR & Payroll → Employees.
@else
@foreach ([['Pending', $summary['pending'], 'warning'], ['Approved', $summary['approved'], 'success'], ['Rejected', $summary['rejected'], 'danger'], ['Days taken '.now()->year, $summary['days_taken'], 'primary']] as [$label, $value, $tone])
{{ $value }}
{{ $label }}
@endforeach
My leave applications
Apply for leave
@if ($items->isEmpty())

You have not applied for any leave yet.

@else
@foreach ($items as $item) @endforeach
Type From To Days Reason Status Reviewed
{{ $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, 80) }} {{ ucfirst($item->status) }} @if ($item->reviewed_at) {{ $item->reviewer?->name ?? 'Admin' }}
{{ $item->reviewed_at->format('d M Y') }} @if ($item->review_note)
{{ $item->review_note }} @endif
@else Awaiting decision @endif
@if ($item->isPending())
@csrf @method('DELETE')
@endif
@endif
@endif @endsection