digits_between accepts a number of decimals.
so in your case it would be : digits_between:1,12
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
I have amount field in table and the datatype is decimal(12,2), how can I validate the amount that the user will not go beyond the size of my field.
I have this but it's wrong
$request->validate([
'amount' => 'required|digits_between:1,99999999999999',
]);
Thank you
Either use @bugsysha 's option
or
'required|numeric|between:-9999999999.99,9999999999.99'
or if you want only positives
'required|numeric|between:0,9999999999.99'
Please or to participate in this conversation.