From 4d367a42d499da7f30e362d9c7d5067ae13d307b Mon Sep 17 00:00:00 2001 From: Sevan Nerse Date: Wed, 11 Dec 2019 23:29:35 +0300 Subject: [PATCH] Middleware updated in order to decide that wizard is completed or not --- .../Middleware/RedirectIfWizardCompleted.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) 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(); } }