Hi, looking at the documentation and testing the code there seems to be no way for me to validate a field is between 0 and 499 (inclusive for both).
https://laravel.com/docs/5.7/validation
All of the validation methods that have to do with number comparison, use the length of the numeric input which is not my use case.
So anyways, I decided to alter my use case and be content with 0 to 999 values so I can just use the 1,3 method which will allow values 0 to 999 but it also allows negative values -1 to -999 because it is computing size and not value.
Any suggestions on how to filter for value and not size, and with regards to my specific use case?
Thank you.
//All of these methods validates by size of the input and not value, leaving me no viable alternative to validate based off of value.
between:min,max
digits_between:min,max
lt:field
gt:field
etc...
EDIT: I did find another post in laracasts
https://laracasts.com/discuss/channels/general-discussion/negative-number-validation?page=1
where the accepted answer it to use min:0 but I don't believe that works to validate negative numbers because min checks length not value. I also tested using min:0 and my negative numbers make it through.
$v = Validator::make($data, [
'something' => 'integer|min:0'
]);