Get the validator instance for the request.

@return \Illuminate\Validation\Validator
501389
protected function getValidatorInstance()
    {
        $this->setupValidationScenario();
        $this->setupValidationParameters();

        $this->validationFactory = $this->container->make(ValidationContract::class);
        $this->validationDispatcher = $this->container->make(DispatcherContract::class);

        return $this->runValidation($this->all(), [], $this->messages());
    }
110280
public function getFilterValidators()
    {
        if ($this->_filters === null) {
            $this->_filters = $this->createFilters();
        }
        return $this->_filters;
    }
890492
public function validateRules()
    {
        $input = request()->all();
        $rules = [];
        $messages = [];

        if ($this->formRequest) {
            $this->formRequest = new $this->formRequest;
            $rules = $this->formRequest->rules();
            $messages = $this->formRequest->messages();
        }

        return Validator::make($input, $rules, $messages);
    }
655055
public function getValidator() {
        if (!$this->_validator instanceof xPDOValidator) {
            $validatorClass = $this->getOption(xPDO::OPT_VALIDATOR_CLASS, null, 'xPDO\\Validation\\xPDOValidator');
            if ($validatorClass = $this->xpdo->loadClass($validatorClass, '', false, true)) {
                $this->_validator = new $validatorClass($this);
            }
        }
        return $this->_validator;
    }
1289978
public function validate()
    {
        if (($_FILES) && (isset($_FILES[$this->name]['name']))) {
            $value = $_FILES[$this->name]['name'];
            $size  = $_FILES[$this->name]['size'];
        } else {
            $value = null;
            $size  = null;
        }
        // Check if the element is required
        if (($this->required) && empty($value)) {
            $this->errors[] = 'This field is required.';
        }
        // Check field validators
        if (count($this->validators) > 0) {
            foreach ($this->validators as $validator) {
                if ($validator instanceof \Pop\Validator\ValidatorInterface) {
                    $class =  get_class($validator);
                    if ((null !== $size) &&
                        (('Pop\Validator\LessThanEqual' == $class) || ('Pop\Validator\GreaterThanEqual' == $class) ||
                         ('Pop\Validator\LessThan' == $class) || ('Pop\Validator\GreaterThan' == $class))) {
                        if (!$validator->evaluate($size)) {
                            $this->errors[] = $validator->getMessage();
                        }
                    } else {
                        if (!$validator->evaluate($value)) {
                            $this->errors[] = $validator->getMessage();
                        }
                    }
                } else if (is_callable($validator)) {
                    $result = call_user_func_array($validator, [$value]);
                    if (null !== $result) {
                        $this->errors[] = $result;
                    }
                }
            }
        }
        return (count($this->errors) == 0);
    }
967644
public function validate()
    {
        $value = $this->getValue();
        // Check if the element is required
        if (($this->required) && empty($value)) {
            $this->errors[] = 'This field is required.';
        }
        // Check field validators
        if (count($this->validators) > 0) {
            foreach ($this->validators as $validator) {
                if ($validator instanceof \Pop\Validator\ValidatorInterface) {
                    if (!$validator->evaluate($value)) {
                        if (!in_array($validator->getMessage(), $this->errors)) {
                            $this->errors[] = $validator->getMessage();
                        }
                    }
                } else if (is_callable($validator)) {
                    $result = call_user_func_array($validator, [$value]);
                    if (null !== $result) {
                        if (!in_array($result, $this->errors)) {
                            $this->errors[] = $result;
                        }
                    }
                }
            }
        }
        return (count($this->errors) == 0);
    }
748307
public function getValidator($name = '')
    {
        if ($this->dirty || !isset($this->validator[$name]) || $this->validator[$name] == null) {
            $this->validator[$name] = $this->buildValidator($this->validators, $name);
            $this->dirty = false;
        }

        return $this->validator[$name];
    }
1084701
public function error()
    {
        $errors = $this->validator->errors();

        $this->error = empty($errors) ?: array_pop($errors)[0];

        return $this->error;
    }
675659
public function validator()
    {
        return Validator::make(
            $this->params, $this->rules(),
            $this->messages(), $this->attributes()
        );
    }
471747
public function getValidator()
    {
        if (!isset($this->validator) && isset($this->configuration)) {
            // Initialize JSON validator.
            $resolver = $this->configuration->getResolver();
            if ($resolver && ($retriever = $resolver->getUriRetriever())) {
                $check_mode = JsonSchema\Validator::CHECK_MODE_NORMAL;
                $this->validator = new JsonSchema\Validator($check_mode, $retriever);
            }
        }

        return $this->validator;
    }
751571
protected function getError()
	{
		return $this->form->error(
			$this->model,
			$this->attribute,
			$this->errorOptions,
			$this->enableAjaxValidation,
			$this->enableClientValidation
		);
	}
400006
protected function getValidatorInstance()
    {
        $factory = $this->container->make(ValidationFactory::class);

        if (method_exists($this, 'validator')) {
            return $this->container->call(array($this, 'validator'), compact('factory'));
        }

        $rules = $this->container->call(array($this, 'rules'));

        return $factory->make($this->all(), $rules, $this->messages(), $this->attributes());
    }
568612
public function getValidator()
    {
        if(!$this->hasValidator() && $this->hasForm()) {
            $this->setValidator(clone $this->getForm()->getValidator());
            $this->getValidator()->clearErrors()->clearMessages()->clearRules();
        }
        return $this->validator;
    }
1092260
public function getValidatorsLocator() {
		if ($this->_validatorsLocator === null) {
			if ($this->hasLocator()) {
				$this->_validatorsLocator = $this->getLocator()->get('validatorsLocator');
				
				if (! $this->_validatorsLocator instanceof LocatorByArgumentsInterface) {
					throw new Exception('Validators\' locator must implements "LocatorByArgumentsInterface" interface');
				}
			} else {
				throw new Exception('Unable to provide validators\' locator');
			}
		}
		
		return $this->_validatorsLocator;
	}
717848
protected function getValidator($field)
	{
		$result = null;
		if (isset($this->validators[$field]))
		{
			$result = $this->validators[$field];
		}
		else
		{
			$result = new ValidatorChain();
			$result->setPluginManager($this->validatorPluginManager);
			if (isset($this->metadata->validators[$field]))
			{
				foreach ($this->metadata->validators[$field] as $validator)
				{
					/** @var $validator Annotation\Validator */
					$result->attachByName($validator->name, $validator->options, true, $validator->priority);
				}
			}
			if (($field !== self::GLOBAL_VALIDATOR_KEY) && ($this->metadata->nullables[$field] === false))
			{
				$result->attachByName(NotEmpty::class, ['type' => NotEmpty::NULL | NotEmpty::OBJECT], true, 10000);
			}
			$this->validators[$field] = $result;
		}
		return $result;
	}
598409
public FacesConfigValidatorType<FacesConfigType<T>> getOrCreateValidator()
   {
      List<Node> nodeList = childNode.get("validator");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigValidatorTypeImpl<FacesConfigType<T>>(this, "validator", childNode, nodeList.get(0));
      }
      return createValidator();
   }
840041
public function validator($resource=null)
    {

        $resource = $this->passedOrCurrent($resource);

        if ($class = $this->mapper->validatorClass($resource)) {
            return $this->makeValidator($resource, $class);
        }

        $modelClass = class_basename($this->modelClass($resource));

        if ($class = $this->finder->validatorClass($resource, $modelClass)) {
            return $this->makeValidator($resource, $class);;
        }

        $class = 'Cmsable\Resource\GenericResourceValidator';

        if ($rules = $this->getManualRules($resource)) {
            $validator = $this->makeValidator($resource, $class);
            return $validator->setRules($rules);
        }

        // Support for rules inside forms
        if (!$this->hasForm($resource)) {
            throw new RuntimeException('No validator for resource $resource found');
        }


        if ($rules = $this->formRules($this->form(null, $resource))) {
             $validator = $this->makeValidator($resource, $class);
             return $validator->setRules($rules);

        }

        throw new RuntimeException('No validator for resource $resource found');

    }