/home/techb158/immovalet.com/platform/core/js-validation/src
Edit: /home/techb158/immovalet.com/platform/core/js-validation/src/RemoteValidationMiddleware.php (1864B)
factory = $validator;
$this->field = $config->get('core.js-validation.js-validation.remote_validation_field');
$this->escape = (bool)$config->get('core.js-validation.js-validation.escape', false);
}
/**
* Handle an incoming request.
*
* @param Request $request
* @param Closure $next
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
if ($request->has($this->field)) {
$this->wrapValidator();
}
return $next($request);
}
/**
* Wraps Validator resolver with RemoteValidator resolver.
*
* @return void
*/
protected function wrapValidator()
{
$resolver = new Resolver($this->factory, $this->escape);
$this->factory->resolver($resolver->resolver($this->field));
$this->factory->extend(RemoteValidator::EXTENSION_NAME, $resolver->validatorClosure());
}
}