@php
$statuses = ['ordered', 'shipped_from_origin', 'in_transit', 'arrived_nigeria', 'ready_for_pickup', 'delivered'];
$shippingRecord = $order->shippingRecords->first();
$currentStatus = $shippingRecord->status ?? ($order->order_status === 'delivered' ? 'delivered' : 'ordered');
$currentIndex = array_search($currentStatus, $statuses);
@endphp
@foreach($statuses as $index => $status)
@if($index < $currentIndex)
@else
{{ $index + 1 }}
@endif
{{ str_replace('_', ' ', ucfirst($status)) }}
@endforeach