@extends('layouts.backend') @section('title', 'Apply Leave') @section('content')

{{ __('Apply Leave') }}

@include('partials.flash')
@if(! $employee)
{{ __('Your account is not linked with an employee profile. Contact HR.') }}
@else
{{ __('New Leave Request') }}
@csrf
@php($isHalfDay = (int) old('is_half_day', 0))
@endif
{{ __('My Leave Requests') }}
@forelse($applications as $application) @empty @endforelse
{{ __('Applied At') }} {{ __('Category') }} {{ __('Date Range') }} {{ __('Days') }} {{ __('Status') }} {{ __('Approver') }} {{ __('Remarks') }}
{{ $application->created_at?->format('Y-m-d H:i') }} {{ $application->leaveCategory?->name ?? '-' }} {{ $application->start_date }} to {{ $application->end_date }} {{ number_format((float) $application->total_days, 2) }} @if($application->status === 'approved') {{ __('Approved') }} @elseif($application->status === 'rejected') {{ __('Rejected') }} @else {{ __('Pending') }} @endif {{ $application->approver?->name ?? '-' }} {{ $application->approval_remarks ?: '-' }}
{{ __('No leave requests found.') }}
{{ $applications->links('pagination::bootstrap-5') }}
@endsection @push('scripts') @endpush