protected function validate()
    {
        $rules = $this->mergeRules();

        if ( empty($rules) ) return true;

        $data = $this->attributes;

        $validator = Validator::make($data, $rules);
        $success = $validator->passes();

        if ( $success )
        {
            if ( $this->validationErrors->count() > 0 )
            {
                $this->validationErrors = new MessageBag;
            }
        } else
        {
            $this->validationErrors = $validator->messages();
            throw new ValidationErrorException($validator->messages());
        }

        $this->valid = true;

        return $success;
    }
protected function validate()
    {
        $rules = $this->mergeRules();

        if ( empty($rules) ) return true;

        $data = $this->attributes;

        $validator = Validator::make($data, $rules);
        $success = $validator->passes();

        if ( $success )
        {
            if ( $this->validationErrors->count() > 0 )
            {
                $this->validationErrors = new MessageBag;
            }
        } else
        {
            $this->validationErrors = $validator->messages();
            throw new ValidationErrorException($validator->messages());
        }

        $this->valid = true;

        return $success;
    }
protected function validate ( ) { $ rules = $ this -> mergeRules ( ) ; if ( empty ( $ rules ) ) return true ; $ data = $ this -> attributes ; $ validator = Validator :: make ( $ data , $ rules ) ; $ success = $ validator -> passes ( ) ; if ( $ success ) { if ( $ this -> validationErrors -> count ( ) > 0 ) { $ this -> validationErrors = new MessageBag ; } } else { $ this -> validationErrors = $ validator -> messages ( ) ; throw new ValidationErrorException ( $ validator -> messages ( ) ) ; } $ this -> valid = true ; return $ success ; }
Validate the model by the defined rules

@throws \Ingruz\Rest\Exceptions\ValidationErrorException
@return boolean
Validate the model by the defined rules