C
C
chelkaz2017-05-08 18:23:51
Laravel
chelkaz, 2017-05-08 18:23:51

Laravel validation between. Why is it missing?

Sending via Ajax:

var point = 'test';
var ecology = '6'; 
data: {point:point, ecology:ecology}

And in the controller, when the ecology field is validated, it is checked!
'ecology' => 'required|integer|digits_between:1,5',

If instead of a number I put another character, then the validation works. But there is no between from 1 to 5... Why?
Tried and just between and digits_between... Tried and var ecology = '6'; and without quotes var ecology = 6;
Everything passes smoothly ... Why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2017-05-08
@chelkaz

digits_between checks the number of digits in a number, not the size of the number. The 6 is one digit, which corresponds to 1 to 5.
between should work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question