public function boot()
{
// load translation files
$this->loadTranslationsFrom(__DIR__ . '/../../lang', 'validation');
// registering intervention validator extension
$this->app['validator']->resolver(function ($translator, $data, $rules, $messages, $customAttributes) {
// set the validation error messages
foreach (get_class_methods('Intervention\\Validation\\Validator') as $method) {
$key = $this->getTranslationKeyFromMethodName($method);
$messages[$key] = $this->getErrorMessage($translator, $messages, $key);
}
return new ValidatorExtension($translator, $data, $rules, $messages, $customAttributes);
});
}