1234556 > 255 => validation error. Laravel is clever and knows from the numeric rule what size check it needs to perform.
Yeah, that number is bigger than 255.
so the max:255 is not the no. of character? I was thinking it is to set the field for varchar(255).
I think you might want the digits rule.—
Sent from Mailbox for iPhone
On Thu, Mar 13, 2014 at 8:27 PM, shiroamada [email protected]
wrote:
so the max:255 is not the no. of character?
Reply to this email directly or view it on GitHub:
https://github.com/laravel/framework/issues/3874#issuecomment-37606503
Okay, thanks taylor!
If you want to limit the number of digits you can use:
'required|numeric|digits:10'
or
'required|numeric|digits_between:10,15'
Thanks tamanti
I have same problem but after this problem was solved..
In my case this works as well
'required|string|min:255',
But how to validate that string is numeric but has less than 255 digits, also it's not required.
Most helpful comment
If you want to limit the number of digits you can use:
'required|numeric|digits:10'
or
'required|numeric|digits_between:10,15'