@extends('layouts.app') @section('title', 'Leave Request Details') @section('content') @php $flow = []; // Step 0: Applied (always green - starting point) $flow[] = ['level' => 0, 'role' => 'Applied', 'is_applied' => true]; $flow[] = ['level' => 1, 'role' => 'Training Officer', 'is_applied' => false]; if ($leaveRequest->student_type === 'hostel') { $flow[] = ['level' => 2, 'role' => 'Warden', 'is_applied' => false]; $flow[] = ['level' => 3, 'role' => 'Asst. Director', 'is_applied' => false]; } else { $flow[] = ['level' => 2, 'role' => 'Asst. Director', 'is_applied' => false]; } $totalSteps = count($flow); $currentLvl = $leaveRequest->current_level; $globalStatus = $leaveRequest->status; if ($globalStatus === 'approved') { $doneLevels = $totalSteps - 1; // all approval steps done (excluding applied) } elseif ($globalStatus === 'rejected') { $doneLevels = max(0, $currentLvl - 1); } else { $doneLevels = max(0, $currentLvl - 1); } // Add 1 to account for the "Applied" step which is always done $doneLevels += 1; @endphp
Leave Request Details
Applied on: {{ $leaveRequest->created_at->format('d M Y, h:i A') }}
{{ $step['role'] }}
{{ $stxt }}
@if($isApplied){{ $leaveRequest->created_at->format('d M Y') }}
@elseif($log && $log->approved_at){{ $log->approved_at->format('d M Y') }}
@endif{{ $log->approver->name }}
{{ $log->levelName }}
{{ $log->approved_at->format('d M Y, h:i A') }}
@if($log->remarks)Attachment Preview