diff --git a/app/Http/Middleware/RedirectIfWizardCompleted.php b/app/Http/Middleware/RedirectIfWizardCompleted.php index 886419f42..bff53a70a 100644 --- a/app/Http/Middleware/RedirectIfWizardCompleted.php +++ b/app/Http/Middleware/RedirectIfWizardCompleted.php @@ -1,5 +1,4 @@ getPathInfo(), '/wizard')) { + // Check wizard is completed or not + if (setting('wizard.completed', 0) == 1) { return $next($request); } - - // Wizard not completed - if (!setting('wizard.completed', 0)) { + + // Already in the wizard + if (Str::startsWith($request->getPathInfo(), '/wizard')) { return $next($request); } - - // Wizard completed, redirect to home - redirect()->intended('/')->send(); + + // Not wizard completed, redirect to wizard + redirect()->route('wizard.edit')->send(); } }