in simple use rules of laravel validator i want to check input for between 1 and 10.
this below role do not work correctly and accept zero
'required|integer|digits_between:1,10'
or
'display_post_count' => 'required|min:1|max:10',
You seem to be using digits_between but you need to be using just between (docs).
'item' => 'required|integer|between:1,10',
digits_between does not work at all. now your answer works well.'item' => 'between:1,10 doesn't work'item' => 'required|between:1,10', will work'item' => 'min:1,max:100'. It will work :)You should use digits_between when you are trying to get exact same "length". for example to validate if user input is a digit between 0 to 99, you just add "digits_between:1,2" in your validation.
'item' => 'required|digits_between:1,2',
If your number is decimal, and want to validate if entered number is a range number between 1, 1.1, 1.2, 1.3, ... to 2, you need use "numeric|between:1,2" in your validation.
'item' => 'required|numeric|between:1,2',
between:min,maxnotdigits_betweenSee: laravel.com/docs/validation#rule-betweenrequired|integer|between:1,10is correct. thanks