Laravel custom messages for array validation

后端 未结 10 2454
南笙
南笙 2021-02-20 05:36

I am having a form and I have an array of input fields for video urls, now when I validate form if I have multiple invalid fields with video urls, I get the same message for eac

10条回答
  •  南方客
    南方客 (楼主)
    2021-02-20 06:08

    This works fine for me in laravel 5.5

    $request->validate([
                'files.*' => 'required|mimes:jpeg,png,jpg,gif,pdf,doc|max:10000'
            ],
            [
                'files.*.mimes' => 'Los archivos solo pueden estar con formato: jpeg, png, jpg, gif, pdf, doc.',
            ]
        );
    

提交回复
热议问题