We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,there.I need a favor. I don't use default error message when I validate some data.Just give user error message I specified.
$userValidator = v::attribute('name', v::stringType()->length(1,32)) ->attribute('birthdate', v::date()->age(18));
$userValidator->validate($user);
like code above,how to make it happen?Such as validate 'name',give user a kind of message that 'name you input is invalid' I specified.
Thank you for your help!
The text was updated successfully, but these errors were encountered:
It is really good question.
Hey, guys. What about make something like in popular NodeJS validators.
like
$field = v::numberic("the value must be null");
Or
$field = v::numberic(new ValidationError("the value must be null"));
Last is not looks pretty, but it more useful;
Sorry, something went wrong.
You can specify your own messages with findMessages(), see http://respect.github.io/Validation/docs/#getting-messages-as-an-array-by-name
findMessages()
If my answer is not enough, feel free to reopen this issue or create a new one any time.
🐼
No branches or pull requests
Hi,there.I need a favor.
I don't use default error message when I validate some data.Just give user error message I specified.
$userValidator = v::attribute('name', v::stringType()->length(1,32))
->attribute('birthdate', v::date()->age(18));
$userValidator->validate($user);
like code above,how to make it happen?Such as validate 'name',give user a kind of message that 'name you input is invalid' I specified.
Thank you for your help!
The text was updated successfully, but these errors were encountered: