protected function nextStep(Request $request)
    {
        // Apply the current step. If success, we can redirect to next one
        $currentStep = \SetupWizard::currentStep();
        if (!$currentStep->apply($request->all())) {
            return view()->make('setup_wizard::steps.default', ['errors' => $currentStep->getMessageBag()]);
        }

        // If we have a next step, go for it. Else we redirect to somewhere else
        try {
            $nextStep = \SetupWizard::nextStep();

            return redirect()->route('setup_wizard.show', ['slug' => $nextStep->getSlug()]);
        } catch (StepNotFoundException $e) {
            $finalRouteName = config('setup_wizard.routing.success_route', '');
            if (!empty($finalRouteName)) return redirect()->route($finalRouteName);

            $finalRouteUrl = config('setup_wizard.routing.success_url', '');
            if (!empty($finalRouteUrl)) return redirect()->to($finalRouteUrl);

            return redirect('/');
        }
    }
protected function nextStep(Request $request)
    {
        // Apply the current step. If success, we can redirect to next one
        $currentStep = \SetupWizard::currentStep();
        if (!$currentStep->apply($request->all())) {
            return view()->make('setup_wizard::steps.default', ['errors' => $currentStep->getMessageBag()]);
        }

        // If we have a next step, go for it. Else we redirect to somewhere else
        try {
            $nextStep = \SetupWizard::nextStep();

            return redirect()->route('setup_wizard.show', ['slug' => $nextStep->getSlug()]);
        } catch (StepNotFoundException $e) {
            $finalRouteName = config('setup_wizard.routing.success_route', '');
            if (!empty($finalRouteName)) return redirect()->route($finalRouteName);

            $finalRouteUrl = config('setup_wizard.routing.success_url', '');
            if (!empty($finalRouteUrl)) return redirect()->to($finalRouteUrl);

            return redirect('/');
        }
    }
protected function nextStep ( Request $ request ) { // Apply the current step. If success, we can redirect to next one $ currentStep = \ SetupWizard :: currentStep ( ) ; if ( ! $ currentStep -> apply ( $ request -> all ( ) ) ) { return view ( ) -> make ( 'setup_wizard::steps.default' , [ 'errors' => $ currentStep -> getMessageBag ( ) ] ) ; } // If we have a next step, go for it. Else we redirect to somewhere else try { $ nextStep = \ SetupWizard :: nextStep ( ) ; return redirect ( ) -> route ( 'setup_wizard.show' , [ 'slug' => $ nextStep -> getSlug ( ) ] ) ; } catch ( StepNotFoundException $ e ) { $ finalRouteName = config ( 'setup_wizard.routing.success_route' , '' ) ; if ( ! empty ( $ finalRouteName ) ) return redirect ( ) -> route ( $ finalRouteName ) ; $ finalRouteUrl = config ( 'setup_wizard.routing.success_url' , '' ) ; if ( ! empty ( $ finalRouteUrl ) ) return redirect ( ) -> to ( $ finalRouteUrl ) ; return redirect ( '/' ) ; } }
Apply current step and move on to next step

@param Request $request

@return Response
Apply current step and move on to next step