@extends('layouts.dashboard') @section('content')
| Leave Type | Date | Leave Count | Attachment | Applied On | Status | Cancel | Cancel On | Cancelled By |
|---|---|---|---|---|---|---|---|---|
| {{ $leave->leave_type ?? $leave->status }} | {{-- Leave Date --}}{{ \Carbon\Carbon::parse($leave->start_date)->format('d M y') }} - {{ \Carbon\Carbon::parse($leave->end_date)->format('d M y') }} | {{-- Leave Count --}}{{ $leave->requesting_days }} | {{-- Attachment --}}@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 | {{-- Applied On --}}{{ \Carbon\Carbon::parse($leave->created_at)->format('d M Y - l') }} | {{-- Status --}}@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 | {{-- Cancel Button --}}@if($leave->leave_status == 0 || $leave->leave_status == 1) @elseif($leave->leave_status == 2) Cancelled @elseif($leave->leave_status == 3) Rejected @endif | {{-- Cancel On --}}@if($leave->leave_status == 2 || $leave->leave_status == 3) {{ \Carbon\Carbon::parse($leave->cancelled_on)->format('d M y') }} @else - @endif | {{-- Cancelled By --}}@if($leave->leave_status == 2 || $leave->leave_status == 3) {{ $leave->cancelledByUser->name ?? $leave->employee->name ?? '-' }} @else - @endif |
| No leave records found | ||||||||