original_string: protected function validate($data, $rules=false)
      {
          if(!$rules)
          {
              $modelName = $this->modelFullName;
              $rules = $modelName::$rules;
          }
          $validator = \Validator::make($data, $rules);
          if($validator->fails()) throw new ValidationException($validator);
          return true;
      }
code: protected function validate($data, $rules=false)
      {
          if(!$rules)
          {
              $modelName = $this->modelFullName;
              $rules = $modelName::$rules;
          }
          $validator = \Validator::make($data, $rules);
          if($validator->fails()) throw new ValidationException($validator);
          return true;
      }
code_tokens: protected function validate ( $ data , $ rules = false ) { if ( ! $ rules ) { $ modelName = $ this -> modelFullName ; $ rules = $ modelName :: $ rules ; } $ validator = \ Validator :: make ( $ data , $ rules ) ; if ( $ validator -> fails ( ) ) throw new ValidationException ( $ validator ) ; return true ; }
docstring: Validate data for resource.
  
  @param array $data
  @param array $rules
  @return boolean
docstring_tokens: Validate data for resource .