original_string: public function postStep1()
      {
          $postData = Binput::all();
  
          $v = Validator::make($postData, $this->rulesStep1);
  
          $v->sometimes('env.mail_host', 'required', function ($input) {
              return $input->env['mail_driver'] === 'smtp';
          });
  
          $v->sometimes(['env.mail_address', 'env.mail_password'], 'required', function ($input) {
              return !in_array($input->env['mail_driver'], ['log', 'smtp']);
          });
  
          $v->sometimes(['env.mail_username'], 'required', function ($input) {
              return !in_array($input->env['mail_driver'], ['sendmail', 'log']);
          });
  
          if ($v->passes()) {
              return Response::json(['status' => 1]);
          }
  
          return Response::json(['errors' => $v->getMessageBag()], 400);
      }
code: public function postStep1()
      {
          $postData = Binput::all();
  
          $v = Validator::make($postData, $this->rulesStep1);
  
          $v->sometimes('env.mail_host', 'required', function ($input) {
              return $input->env['mail_driver'] === 'smtp';
          });
  
          $v->sometimes(['env.mail_address', 'env.mail_password'], 'required', function ($input) {
              return !in_array($input->env['mail_driver'], ['log', 'smtp']);
          });
  
          $v->sometimes(['env.mail_username'], 'required', function ($input) {
              return !in_array($input->env['mail_driver'], ['sendmail', 'log']);
          });
  
          if ($v->passes()) {
              return Response::json(['status' => 1]);
          }
  
          return Response::json(['errors' => $v->getMessageBag()], 400);
      }
code_tokens: public function postStep1 ( ) { $ postData = Binput :: all ( ) ; $ v = Validator :: make ( $ postData , $ this -> rulesStep1 ) ; $ v -> sometimes ( 'env.mail_host' , 'required' , function ( $ input ) { return $ input -> env [ 'mail_driver' ] === 'smtp' ; } ) ; $ v -> sometimes ( [ 'env.mail_address' , 'env.mail_password' ] , 'required' , function ( $ input ) { return ! in_array ( $ input -> env [ 'mail_driver' ] , [ 'log' , 'smtp' ] ) ; } ) ; $ v -> sometimes ( [ 'env.mail_username' ] , 'required' , function ( $ input ) { return ! in_array ( $ input -> env [ 'mail_driver' ] , [ 'sendmail' , 'log' ] ) ; } ) ; if ( $ v -> passes ( ) ) { return Response :: json ( [ 'status' => 1 ] ) ; } return Response :: json ( [ 'errors' => $ v -> getMessageBag ( ) ] , 400 ) ; }
docstring: Handles validation on step one of the setup form.
  
  @return \Illuminate\Http\Response
docstring_tokens: Handles validation on step one of the setup form .