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;
    }
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;
    }
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 ; }
Validate data for resource.

@param array $data
@param array $rules
@return boolean
Validate data for resource .