protected function validate(Model $model)
    {
        $attributes = $model->getAttributes();

        $messages = isset($model->validationMessages) ? $model->validationMessages : [];

        $validator = $this->factory->make($attributes, $model->rules, $messages);

        if ($validator->fails()) {
            throw new ValidationException($validator->getMessageBag());
        }

        if (method_exists($model, 'validate')) {
            $model->validate();
        }
    }
protected function validate(Model $model)
    {
        $attributes = $model->getAttributes();

        $messages = isset($model->validationMessages) ? $model->validationMessages : [];

        $validator = $this->factory->make($attributes, $model->rules, $messages);

        if ($validator->fails()) {
            throw new ValidationException($validator->getMessageBag());
        }

        if (method_exists($model, 'validate')) {
            $model->validate();
        }
    }
protected function validate ( Model $ model ) { $ attributes = $ model -> getAttributes ( ) ; $ messages = isset ( $ model -> validationMessages ) ? $ model -> validationMessages : [ ] ; $ validator = $ this -> factory -> make ( $ attributes , $ model -> rules , $ messages ) ; if ( $ validator -> fails ( ) ) { throw new ValidationException ( $ validator -> getMessageBag ( ) ) ; } if ( method_exists ( $ model , 'validate' ) ) { $ model -> validate ( ) ; } }
Validate the given model.

@param \Illuminate\Database\Eloquent\Model $model

@throws \AltThree\Validator\ValidationException

@return void
Validate the given model .