Add specific message for username validation

This commit is contained in:
Toby Zerner 2016-11-28 10:47:43 +10:30
parent b010b0b486
commit bc557299b2
2 changed files with 10 additions and 1 deletions

View File

@ -14,7 +14,6 @@ use Flarum\Event\ConfigureValidator;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Validation\ValidationException;
use Illuminate\Validation\Factory;
use Illuminate\Validation\Validator;
use Symfony\Component\Translation\TranslatorInterface;
abstract class AbstractValidator

View File

@ -61,4 +61,14 @@ class UserValidator extends AbstractValidator
]
];
}
/**
* {@inheritdoc}
*/
protected function getMessages()
{
return [
'username.regex' => $this->translator->trans('core.api.invalid_username_message')
];
}
}