I am using laravel and I want to validate request like this
'specification' => 'min:1|max:100000|regex:/^[ا-یa-zA-Z0-9- ]+$/u',
but it is as a array like this
it works well with string but not validate array
Advertisement
Answer
Try this
'specification.*' => 'min:1|max:100000|regex:/^[ا-یa-zA-Z0-9- ]+$/u'
when you have an array from input then the .*
applies the validation rule to every item in that array