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
Description: creating a rule with a Anonymous class does not allow custom error message. Any ideia how it can be done? Thanks
$v = (new v)->key('Address', (new class extends AbstractRule { public function validate($input): bool { return false; } })->setTemplate("{{name}} is not good!"), true); try { $v->assert(['Address' => "cvejvn"]); } catch (NestedValidationException $e) { var_dump($e->getFullMessage()); }
Output:
array(1) { ["Address"]=> string(21) "Address must be valid" }
The text was updated successfully, but these errors were encountered:
Thank you for reporting! 🐼
This has been fixed in version 3.0, and I although it's a bug, I would not like to spend time fixing it on version 2.3 😅.
I'm sorry, but you're gonna have to wait until I release version 3.0, which will probably be at the beginning of next year.
Sorry, something went wrong.
For reference: https://github.com/Respect/Validation/blob/ea29c2c43a49bf83de7768883b1fd567785e6ff4/tests/integration/issues/1477.phpt
No branches or pull requests
Description:
creating a rule with a Anonymous class does not allow custom error message. Any ideia how it can be done? Thanks
Output:
The text was updated successfully, but these errors were encountered: