In the Laravel form input validation, you can specify the minimum and maximum length of the specified input field.
$inputRules = [ 'postCode' => 'min:3|max:8' ];
Result of checking
- 'BA45TZ' =
true - 'FF' =
false - 'GH22 55XYZ' =
false
However, if I do the same for the number, it will check if the input is less or more than the input, and then return it.
$inputRules = [ 'cv2' => 'min:3|max:4' ];
Result of checking
- '586' =
false - '4' =
true - '2' =
false - '3' =
true
I really want to check the length of numbers, not a numerical value. I canβt figure out how to do this. Google did not help, or I did not search for the right things.
Anyone have experience with this?
EDIT: I answered my question. I missed Laravels digits_between .
source share