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
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community