public function register()
{
// Whenever the validator factory is accessed in the container, we set
// the custom resolver on it (this works in Larvel >= 5.2 as well).
$this->app->resolving('validator', function ($factory, $app) {
$factory->resolver(function ($translator, $data, $rules, $messages, $customAttributes = []) {
return new ValidatorExtension($translator, $data, $rules, $messages, $customAttributes);
});
});
}