mirror of
https://github.com/flarum/framework.git
synced 2025-01-23 04:49:46 +08:00
Add specific message for username validation
This commit is contained in:
parent
b010b0b486
commit
bc557299b2
|
@ -14,7 +14,6 @@ use Flarum\Event\ConfigureValidator;
|
||||||
use Illuminate\Contracts\Events\Dispatcher;
|
use Illuminate\Contracts\Events\Dispatcher;
|
||||||
use Illuminate\Contracts\Validation\ValidationException;
|
use Illuminate\Contracts\Validation\ValidationException;
|
||||||
use Illuminate\Validation\Factory;
|
use Illuminate\Validation\Factory;
|
||||||
use Illuminate\Validation\Validator;
|
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
abstract class AbstractValidator
|
abstract class AbstractValidator
|
||||||
|
|
|
@ -61,4 +61,14 @@ class UserValidator extends AbstractValidator
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected function getMessages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'username.regex' => $this->translator->trans('core.api.invalid_username_message')
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user