简体   繁体   中英

Validate multiple file with same name validate in laravel

below are my form inputs :

<input type="file" name="image[]" multiple="true"></input>
<input type="file" name="image[]" multiple="true"></input>

and validation rules which i have used is :

'image' => 'required',
'image.*' => 'required',

I want to validate both the image file required But by above code only first image type is validating.

instead of

'image' => 'required',
'image.*' => 'required',

you could use

'image.*' => 'required',

this might solve your problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM