{{-- Where you are in the four steps. Steps already passed are links back, so a wrong patient can be corrected without abandoning the tests already chosen — the draft survives, and stepping back is the cheap way to fix a mistake rather than starting over. Steps ahead are not links: they need the answers this one is asking for. --}} @php $steps = [ ['key' => 'patient', 'label' => __('laboratory::messages.wizard.step_patient'), 'route' => 'lab.new-test.patient'], ['key' => 'tests', 'label' => __('laboratory::messages.wizard.step_tests'), 'route' => 'lab.new-test.tests'], ['key' => 'review', 'label' => __('laboratory::messages.wizard.step_review'), 'route' => 'lab.new-test.review'], ]; $positions = array_column($steps, 'key'); $currentIndex = array_search($current, $positions, true); $currentIndex = $currentIndex === false ? 0 : $currentIndex; @endphp
    @foreach ($steps as $index => $step) @php $isCurrent = $index === $currentIndex; $isDone = $index < $currentIndex; $classes = 'px-steps__item'.($isCurrent ? ' px-steps__item--current' : ($isDone ? ' px-steps__item--done' : '')); @endphp
  1. @if ($isDone) {{ $index + 1 }} {{ $step['label'] }} @else {{ $index + 1 }} {{ $step['label'] }} @endif
  2. @endforeach