Reputation: 5063
How I limit the quantity of decimals in a input number of laravelCollective?
Upvotes: 4
Views: 11348
Reputation: 141
In the Laravel using the FORM, you need change the parameter 'step'.
{!! Form::number('preco', null, ['class' => 'form-control','step' => '0.1']) !!}
Upvotes: 13
Reputation: 651
The Laravel between validation rule is actually pretty powerful and can handle decimal values as well. So there's no need to use regex just do this:
'required|between:0,99.99'
Answer taken from here: Laravel validate decimal 0-99.99
Upvotes: 3