Have you considered extending validator? https://laravel.com/docs/5.1/validation#custom-validation-rules
Dec 31, 2015
16
Level 13
laravel validation float number only positive
Dear community,
in my app users should be able to create coupons for other users, using their own amount of money. I need to validate the entered number of amount a user wants to use for creating a coupon.
The amount of money for a coupon must be at least 1,00. How to validate, so the user can input:
-float numbers seperated by , and . (1,15 3.04)
-numbers must be at least 1,0 (1.0)
-numbers must be smaller than 50,00 (50.00)
The numeric validator wont work, because of it allows +/- and doesn't accept amounts seperated by dots. What's the best way to validate entries like above using laravel validator?
Please or to participate in this conversation.