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', ], ])
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners