Support the ongoing development of Laravel.io →
posted 9 years ago
Eloquent
Last updated 2 years ago.
0

Why not use strlen()?

0

In the validation rules for the Controller or its Request class use one of these (days is the field being checked):

Exactly 10:

        public function rules()
        {
                return [
                    'days' => 'required|digits:10',
                ];
        }

Between 1 and 10:

        public function rules()
        {
                return [
                    'days' => 'required|digits_between:1,10',
                ];
        }

reference: http://laravel.com/docs/5.1/validation

Last updated 9 years ago.
0

Thanks will try that arikin.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

icame21 icame21 Joined 30 Sep 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.