Support the ongoing development of Laravel.io →
posted 7 years ago
Eloquent
Last updated 10 months 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 7 years ago.
0

Thanks will try that arikin.

0

Sign in to participate in this thread!

LoadForge

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.

© 2023 Laravel.io - All rights reserved.