original_string: 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('/');
          }
      }
code: 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('/');
          }
      }
code_tokens: 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 ( '/' ) ; } }
docstring: Apply current step and move on to next step
  
  @param Request $request
  
  @return Response
docstring_tokens: Apply current step and move on to next step