New issue
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
Custom Validation Message #37
Comments
You can use $validation->setMessages([
// Custom error by field name
'name' => 'You have invalid name',
// or make it specific
'name:required' => 'Field name is required guys',
// or by rule name
'required' => 'Field :attribute is required guys'
]);
// then validate it
$validation->validate(); |
Hi, Emsifa. Thank you very much for you quick reply. My code is running pretty nice right now. I have another question: How do I use the unique validation with MVC? My project is under MVC pattern and I'd like to use your class to verify if a column name is already taken |
You can add custom rule class like this. |
Thanks for helping me again.
Can I put the above code inside of setMessages() using json? |
No, you should |
I think this issue have been solved. I should close this. Thanks. |
Hi, there. Thanks for sharing with us this amazing class!
Well, my validation code is working pretty well but I didn't understand how to custom validation messages. I want to do that cause I need generate messages into brazilian portuguese.
See the below code:
How do I custom messages to those fields using rakit class?
Thanks in advance.
The text was updated successfully, but these errors were encountered: