original_string: public function postStep3()
      {
          $postData = Binput::all();
  
          $v = Validator::make($postData, $this->rulesStep1 + $this->rulesStep2 + $this->rulesStep3);
  
          if ($v->passes()) {
              // Pull the user details out.
              $userDetails = Arr::pull($postData, 'user');
  
              $user = User::create([
                  'username' => $userDetails['username'],
                  'email'    => $userDetails['email'],
                  'password' => $userDetails['password'],
                  'level'    => User::LEVEL_ADMIN,
              ]);
  
              Auth::login($user);
  
              $setting = app(Repository::class);
  
              $settings = Arr::pull($postData, 'settings');
  
              foreach ($settings as $settingName => $settingValue) {
                  $setting->set($settingName, $settingValue);
              }
  
              $envData = Arr::pull($postData, 'env');
  
              // Write the env to the .env file.
              execute(new UpdateConfigCommand($envData));
  
              if (Request::ajax()) {
                  return Response::json(['status' => 1]);
              }
  
              return cachet_redirect('dashboard');
          }
  
          if (Request::ajax()) {
              return Response::json(['errors' => $v->getMessageBag()], 400);
          }
  
          return cachet_redirect('setup')->withInput()->withErrors($v->getMessageBag());
      }
code: public function postStep3()
      {
          $postData = Binput::all();
  
          $v = Validator::make($postData, $this->rulesStep1 + $this->rulesStep2 + $this->rulesStep3);
  
          if ($v->passes()) {
              // Pull the user details out.
              $userDetails = Arr::pull($postData, 'user');
  
              $user = User::create([
                  'username' => $userDetails['username'],
                  'email'    => $userDetails['email'],
                  'password' => $userDetails['password'],
                  'level'    => User::LEVEL_ADMIN,
              ]);
  
              Auth::login($user);
  
              $setting = app(Repository::class);
  
              $settings = Arr::pull($postData, 'settings');
  
              foreach ($settings as $settingName => $settingValue) {
                  $setting->set($settingName, $settingValue);
              }
  
              $envData = Arr::pull($postData, 'env');
  
              // Write the env to the .env file.
              execute(new UpdateConfigCommand($envData));
  
              if (Request::ajax()) {
                  return Response::json(['status' => 1]);
              }
  
              return cachet_redirect('dashboard');
          }
  
          if (Request::ajax()) {
              return Response::json(['errors' => $v->getMessageBag()], 400);
          }
  
          return cachet_redirect('setup')->withInput()->withErrors($v->getMessageBag());
      }
code_tokens: public function postStep3 ( ) { $ postData = Binput :: all ( ) ; $ v = Validator :: make ( $ postData , $ this -> rulesStep1 + $ this -> rulesStep2 + $ this -> rulesStep3 ) ; if ( $ v -> passes ( ) ) { // Pull the user details out. $ userDetails = Arr :: pull ( $ postData , 'user' ) ; $ user = User :: create ( [ 'username' => $ userDetails [ 'username' ] , 'email' => $ userDetails [ 'email' ] , 'password' => $ userDetails [ 'password' ] , 'level' => User :: LEVEL_ADMIN , ] ) ; Auth :: login ( $ user ) ; $ setting = app ( Repository :: class ) ; $ settings = Arr :: pull ( $ postData , 'settings' ) ; foreach ( $ settings as $ settingName => $ settingValue ) { $ setting -> set ( $ settingName , $ settingValue ) ; } $ envData = Arr :: pull ( $ postData , 'env' ) ; // Write the env to the .env file. execute ( new UpdateConfigCommand ( $ envData ) ) ; if ( Request :: ajax ( ) ) { return Response :: json ( [ 'status' => 1 ] ) ; } return cachet_redirect ( 'dashboard' ) ; } if ( Request :: ajax ( ) ) { return Response :: json ( [ 'errors' => $ v -> getMessageBag ( ) ] , 400 ) ; } return cachet_redirect ( 'setup' ) -> withInput ( ) -> withErrors ( $ v -> getMessageBag ( ) ) ; }
docstring: Handles the actual app setup, including user, settings and env.
  
  @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response
docstring_tokens: Handles the actual app setup including user settings and env .