Closed xx10n31y closed 3 years ago
Validation is managed by Laravel.
As you are writing it validator has no way to know if you want to apply max
rule as a string or number so it's applying it as a string counting characters.
You need to add integer or numeric to force the rule as number.
Validation is managed by Laravel. As you are writing it validator has no way to know if you want to apply
max
rule as a string or number so it's applying it as a string counting characters.You need to add integer or numeric to force the rule as number.
Thanks for your responded. I added an integer
into the rule
, but also not working. So only to use the max
attribute.
{
"validation": {
"rule": "required|integer|min:0|max:200",
"messages": {
"required": "This :attribute field is a must.",
"max": "This :attribute field maximum :max."
}
},
"max": 100
}
Doing an inline validation will work properly Ex
{
"validation": {
"rule": "required|between:3,255|string"
}
}
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
Version information
Description
The validation use max validator but that was not working
Steps To Reproduce
Steps to reproduce the behavior:
Bread
rank
column is a signed tinyint in MySQL, and max is 127Expected behavior
The
max
validator should get back the error message but that just throw a exceptionScreenshots