@php $lastPath = collect(request()->segments())->last(); $applicationNumber = request()->query('application_number'); $locationId = request()->query('location_id'); $bEType = $data->getBusinessType(['merchant_location_id' => $locationId, 'first' => true]) ?? 0; // Check if user is authenticated $isAuthenticated = auth()->check(); // If not authenticated, get token from URL query parameters $token = $isAuthenticated ? null : request()->query('token'); $steps = [ ['label' => 'Business', 'icon' => 'bx bx-building-house', 'path' => 'business-overview'], ['label' => $bEType != 4 ? 'Owners' : 'Principals', 'icon' => 'fas fa-users', 'path' => 'owners-info'], ['label' => 'Bank', 'icon' => 'bx bxs-bank', 'path' => 'bank-info'], ['label' => 'Pricing', 'icon' => 'bx bx-dollar-circle', 'path' => 'pricing'], ['label' => 'Products', 'icon' => 'fas fa-boxes', 'path' => 'products'], ['label' => 'Review', 'icon' => 'bx bx-news', 'path' => 'review'], ]; @endphp
@foreach ($steps as $index => $step) @php $isActive = $lastPath === $step['path']; $isCompleted = $data->onboarding_level > $index; $classes = ''; if ($isActive) { $classes .= 'active'; if ($data->onboarding_level >= $index + 1) { $classes .= ' completed'; } } elseif ($isCompleted) { $classes .= 'completed'; } $routeParams = [ 'application_number' => $applicationNumber, 'location_id' => $locationId, ]; if (!$isAuthenticated && $token) { $routeParams['token'] = $token; } @endphp @endforeach