In the new version 9.26 we have the feature min_digits and max_digits validation According to the size rule, the number of digits in a digital input cannot be traditionally validated using min and max. Currently, we have digits to validate the exact length of a number, and digits_between to validate the length within two bounds.
This PR offers two validation rules - min_digits and max_digits for this usage https://github.com/laravel/framework/pull/43797 Validator::validate([ 'number' => 1000, ], [ 'number' => [ // Passes as `1000` has 4 digits 'min_digits:3', 'max_digits:5', // Fails as `1000` is greater than 5 'min:3', 'max:5', ], ])