@extends('layouts.dashboard') @section('content')

Leave Report - {{ $employee->name ?? 'Unknown Employee' }}

{{-- Back Button --}}
Back
{{-- Filter Form --}}
Leave Details
{{-- Leave Table --}}
@forelse($leaveDetails as $leave) {{-- Leave Type --}} {{-- Leave Date --}} {{-- Leave Count --}} {{-- Attachment --}} {{-- Applied On --}} {{-- Status --}} {{-- Cancel Button --}} {{-- Cancel On --}} {{-- Cancelled By --}} @empty @endforelse
Leave Type Date Leave Count Attachment Applied On Status Cancel Cancel On Cancelled By
{{ $leave->leave_type ?? $leave->status }} {{ \Carbon\Carbon::parse($leave->start_date)->format('d M y') }} - {{ \Carbon\Carbon::parse($leave->end_date)->format('d M y') }} {{ $leave->requesting_days }} @php $attachments = is_array($leave->attachment) ? $leave->attachment : json_decode($leave->attachment, true); $attachmentFile = $attachments[0] ?? $leave->attachment ?? null; @endphp @if($attachmentFile) View @else No Attachment @endif {{ \Carbon\Carbon::parse($leave->created_at)->format('d M Y - l') }} @if($leave->customNotification) @if($leave->customNotification->employee_leave_id == 1) Approved @elseif($leave->customNotification->employee_leave_id == 0) Rejected @else Unknown @endif @else @switch($leave->leave_status) @case(0) Pending @break @case(1) Approved @break @case(2) Cancelled @break @case(3) Rejected @break @default Unknown @endswitch @endif @if($leave->leave_status == 0 || $leave->leave_status == 1)
@csrf @method('PUT')
@elseif($leave->leave_status == 2) Cancelled @elseif($leave->leave_status == 3) Rejected @endif
@if($leave->leave_status == 2 || $leave->leave_status == 3) {{ \Carbon\Carbon::parse($leave->cancelled_on)->format('d M y') }} @else - @endif @if($leave->leave_status == 2 || $leave->leave_status == 3) {{ $leave->cancelledByUser->name ?? $leave->employee->name ?? '-' }} @else - @endif
No leave records found
{{-- jQuery --}} {{-- SweetAlert --}} {{-- Bootstrap Datepicker --}} {{-- SweetAlert Messages --}} @if(session('success')) @endif @if(session('already_cancelled')) @endif @if(session('error')) @endif @endsection