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
I tried to change the error message.
$validator->setMessages([ "required", ":attribute is empty", "password:min", ":attribute characters should not less than 6" ]); $validation = $validator->validate($request->post("all"), [ "username" => "required", "password" => "required|min:6" ] );
but the output is like this.
object(Rakit\Validation\ErrorBag)#678 (1) { ["messages":protected]=> array(2) { ["username"]=> array(1) { ["required"]=> string(24) "The Username is required" } ["password"]=> array(1) { ["min"]=> string(25) "The Password minimum is 6" } } }
The text was updated successfully, but these errors were encountered:
Your setMessages() call is wrong, you need to pass data in array format, like:
$validator->setMessages([ "required" => ":attribute is empty", "password:min" => ":attribute characters should not less than 6" ]); $validation = $validator->validate($request->post("all"), [ "username" => "required", "password" => "required|min:6" ]);
Sorry, something went wrong.
No branches or pull requests
I tried to change the error message.
$validator->setMessages([
"required", ":attribute is empty",
"password:min", ":attribute characters should not less than 6"
]);
$validation = $validator->validate($request->post("all"), [
"username" => "required",
"password" => "required|min:6"
]
);
but the output is like this.
object(Rakit\Validation\ErrorBag)#678 (1) { ["messages":protected]=> array(2) {
["username"]=> array(1) { ["required"]=> string(24) "The Username is required" }
["password"]=> array(1) { ["min"]=> string(25) "The Password minimum is 6" } }
}
The text was updated successfully, but these errors were encountered: