コード例 #1
0
 protected function previousStep(Request $request)
 {
     try {
         // Undo the previous step. If success, we can redirect to its form
         $previousStep = \SetupWizard::previousStep();
         if (!$previousStep->undo()) {
             return view()->make('setup_wizard::steps.default', ['errors' => $previousStep->getMessageBag()]);
         }
         return redirect()->route('setup_wizard.show', ['slug' => $previousStep->getSlug()]);
     } catch (StepNotFoundException $e) {
         return redirect()->route('setup_wizard.show');
     }
 }
コード例 #2
0
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  * @param  string|null              $guard
  *
  * @return mixed
  */
 public function handle($request, Closure $next, $guard = null)
 {
     // Send a forbidden status if wizard should not be triggered
     if (TriggerHelper::hasWizardCompleted()) {
         return $this->forbiddenResponse();
     }
     // Get the current step from the route slug
     $currentStepSlug = $request->route()->getParameter('slug', '');
     \SetupWizard::initialize($currentStepSlug);
     // Share common data with our views
     view()->share('currentStep', \SetupWizard::currentStep());
     view()->share('allSteps', \SetupWizard::steps());
     // Proceed as usual
     return $next($request);
 }
コード例 #3
0
ファイル: class.upgrader.php プロジェクト: ed00m/osTicket-1.8
 function check_prereq()
 {
     return parent::check_prereq() && $this->check_mysql_version();
 }