original_string: public function validator(Factory $factory)
      {
          if (!$this->shouldBeValidated()) {
              return $factory->make([], []);
          }
          
          $rules = app()->call([$this, 'rules']);
  
          return $factory->make(
              $this->all(), $rules, $this->messages(), $this->attributes()
          );
      }
code: public function validator(Factory $factory)
      {
          if (!$this->shouldBeValidated()) {
              return $factory->make([], []);
          }
          
          $rules = app()->call([$this, 'rules']);
  
          return $factory->make(
              $this->all(), $rules, $this->messages(), $this->attributes()
          );
      }
code_tokens: public function validator ( Factory $ factory ) { if ( ! $ this -> shouldBeValidated ( ) ) { return $ factory -> make ( [ ] , [ ] ) ; } $ rules = app ( ) -> call ( [ $ this , 'rules' ] ) ; return $ factory -> make ( $ this -> all ( ) , $ rules , $ this -> messages ( ) , $ this -> attributes ( ) ) ; }
docstring: Injects validator with rules and data if validation is required
  
  @param Factory $factory
  
  @return Validator
docstring_tokens: Injects validator with rules and data if validation is required