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();
        }
    }