@php function getStatusProgressWidth($status) { $statuses = [ 'pending' => 0, 'processing' => 1, 'in_progress' => 2, 'completed' => 3, // Other statuses like 'declined', 'canceled', 'refunded' will not move the progress bar. ]; // We'll calculate the width based on stages. $totalStages = 4; // pending, processing, in_progress, completed $currentStage = isset($statuses[$status]) ? $statuses[$status] : 0; return ($currentStage / $totalStages) * 100; // Percentage width } @endphp