vendor/rachidlaasri/laravel-installer/src/Controllers/EnvironmentController.php
/**
     * Processes the newly saved environment configuration (Form Wizard).
     *
     * @param Request $request
     * @param Redirector $redirect
     * @return \Illuminate\Http\RedirectResponse
     */
Processes the newly saved environment configuration (Form Wizard).
@param Request $request
@param Redirector $redirect
@return \Illuminate\Http\RedirectResponse
Processes the newly saved environment configuration ( Form Wizard ) . @param Request $request @param Redirector $redirect @return \ Illuminate \ Http \ RedirectResponse
public function saveWizard(Request $request, Redirector $redirect)
    {
        try {
            $conn = new \mysqli($request->database_hostname, $request->database_username, $request->database_password, $request->database_name, $request->database_port);
        }
        catch(\Exception $e) {
            \Session::put('error_message', $e->getMessage());
            return  $redirect->route('LaravelInstaller::environmentWizard');
        }
        $rules = config('installer.environment.form.rules');
        $messages = [
            'environment_custom.required_if' => trans('installer_messages.environment.wizard.form.name_required'),
        ];
        $validator = Validator::make($request->all(), $rules, $messages);
        if ($validator->fails()) {
            $errors = $validator->errors();
            return view('vendor.installer.environment-wizard', compact('errors'));
        }
        $results = $this->EnvironmentManager->saveFileWizard($request);
        if($results['is_success']) {
            event(new EnvironmentSaved($request));
            return $redirect->route('LaravelInstaller::database')->with(['results' => $results['message']]);
        }else{
            \Session::put('error_message', $results['message']);
            return  $redirect->route('LaravelInstaller::environmentWizard');
        }
    }
public function saveWizard ( Request $ request , Redirector $ redirect ) { try { $ conn = new \ mysqli ( $ request -> database_hostname , $ request -> database_username , $ request -> database_password , $ request -> database_name , $ request -> database_port ) ; } catch ( \ Exception $ e ) { \ Session :: put ( 'error_message' , $ e -> getMessage ( ) ) ; return $ redirect -> route ( 'LaravelInstaller::environmentWizard' ) ; } $ rules = config ( 'installer.environment.form.rules' ) ; $ messages = [ 'environment_custom.required_if' => trans ( 'installer_messages.environment.wizard.form.name_required' ) , ] ; $ validator = Validator :: make ( $ request -> all ( ) , $ rules , $ messages ) ; if ( $ validator -> fails ( ) ) { $ errors = $ validator -> errors ( ) ; return view ( 'vendor.installer.environment-wizard' , compact ( 'errors' ) ) ; } $ results = $ this -> EnvironmentManager -> saveFileWizard ( $ request ) ; if ( $ results [ 'is_success' ] ) { event ( new EnvironmentSaved ( $ request ) ) ; return $ redirect -> route ( 'LaravelInstaller::database' ) -> with ( [ 'results' => $ results [ 'message' ] ] ) ; } else { \ Session :: put ( 'error_message' , $ results [ 'message' ] ) ; return $ redirect -> route ( 'LaravelInstaller::environmentWizard' ) ; } }
Processes the newly saved environment configuration (Form Wizard).
Processes the newly saved environment configuration ( Form Wizard ) .