public function validateOrFail(array $data, $model=null)
    {

        $this->publish('validating', [$this, $data, $model]);

        $rules = $this->rules();

        $parsedRules = $this->parseRules($rules, $data, $model);

        $this->publish('validation-rules.parsed', [&$parsedRules]);

        $validator = $this->getValidatorInstance($parsedRules, $data, $model);
        $validator->setAttributeNames($this->customAttributes());

        if ($this->validate($validator)) {
            return true;
        }

        throw new \Illuminate\Validation\ValidationException($validator);

    }