@php $steps = [ '2a' => ['label' => 'Data Permohonan', 'icon' => 'bi-person-lines-fill'], '2b' => ['label' => 'Lahan & Produksi', 'icon' => 'bi-tree-fill'], '2c' => ['label' => 'Biaya & Pendapatan','icon' => 'bi-calculator-fill'], '2d' => ['label' => 'Dokumen & Submit', 'icon' => 'bi-upload'], ]; $stepOrder = array_keys($steps); $currentIdx = array_search($currentStep, $stepOrder); if ($currentIdx === false) { $currentIdx = 0; } @endphp {{-- Desktop Stepper --}}
@foreach($steps as $key => $info) @php $idx = array_search($key, $stepOrder); $state = $idx < $currentIdx ? 'completed' : ($key === $currentStep ? 'active' : 'pending'); @endphp
@if($state === 'completed') @else {{ $idx + 1 }} @endif
{{ $info['label'] }}
@if(!$loop->last)
@endif
@endforeach
{{-- Mobile Stepper --}}
Langkah {{ $currentIdx + 1 }} / {{ count($steps) }} {{ $steps[$currentStep]['label'] ?? '' }}