@php use App\Enums\LicenseStatus; @endphp
{{-- Show created info --}}
{{ LicenseStatus::CREATED->getLabel() }}
{{ $getRecord()->created_at->format('d-m-Y') }} {{ $getRecord()->createdBy?->name ?? '—' }}
{{-- Loop through approval statuses (PENDING_REQUIREMENTS, INITIAL_APPROVAL, FINAL_APPROVAL, APPROVED) --}} @php $afterCurrent = false; $approvalStatuses = [ LicenseStatus::PENDING_REQUIREMENTS, LicenseStatus::INITIAL_APPROVAL, LicenseStatus::FINAL_APPROVAL, ]; @endphp @foreach($approvalStatuses as $status) @php $isCompleted = $getRecord()->isStatusCompleted($status->value); $activity = $getRecord()->getActivityForStatus($status->value); $isCurrent = $getRecord()->status === $status; if ($isCurrent) { $afterCurrent = true; } @endphp
{{ $status->getLabel() }}
@if($afterCurrent && !$isCurrent)
@elseif($isCompleted && !$isCurrent)
@else
@endif
@if($afterCurrent || $isCurrent) {{ '—' }} {{ '—' }} @else {{ $activity?->created_at ? $activity->created_at->format('d-m-Y') : '—' }} {{ $activity?->causer?->name ?? '—' }} @endif
@endforeach {{-- Show rejected status if applicable --}} @if($getRecord()->status === LicenseStatus::REJECTED)
{{ LicenseStatus::REJECTED->getLabel() }}
@php $rejectedActivity = $getRecord()->getActivityForStatus(LicenseStatus::REJECTED->value); @endphp {{ $rejectedActivity?->created_at ? $rejectedActivity->created_at->format('d-m-Y') : '—' }} {{ $rejectedActivity?->causer?->name ?? '—' }}
@endif