@php $statuses = [ 'draft' => ['label' => 'Draft', 'icon' => 'bi-pencil-square'], 'confirmed' => ['label' => 'Confirmed', 'icon' => 'bi-check-circle'], 'processing' => ['label' => 'Processing', 'icon' => 'bi-gear'], 'booked' => ['label' => 'Booked', 'icon' => 'bi-ship'], 'shipped' => ['label' => 'Shipped', 'icon' => 'bi-truck'], 'in_transit' => ['label' => 'In Transit', 'icon' => 'bi-arrow-right-circle'], 'delivered' => ['label' => 'Delivered', 'icon' => 'bi-check-circle-fill'], ]; $currentStatus = $order->status ?? 'draft'; $statusKeys = array_keys($statuses); $currentIndex = array_search($currentStatus, $statusKeys); if ($currentIndex === false) $currentIndex = 0; @endphp
@foreach($statuses as $key => $status) @php $pos = array_search($key, $statusKeys); $isActive = $pos <= $currentIndex; $isCurrent = $key === $currentStatus; @endphp
{{ $status['label'] }}
@if(!$loop->last)
@endif @endforeach