Level 26
With 5.2 you can use
$rules = [
'images.*' => 'mimes:png,jpeg',
]
this will validate all images .
check matt Stauffer tutorial tutorial
Hello,
5.2 - When Im uploading multiple files, mime error doesnt work , errorBag is empty.
It works fine on single file upload.
public function rules()
{
$rules = [];
if(count($this->file('images')) > 0){
foreach($this->file('images') as $key=>$img){
if($img != null){
$rules['images.'.$key] = 'mimes:png,jpeg';
}
}
}
return $rules;
}
Solution is to add protected variable in request
protected $dontFlash = ['images']
Please or to participate in this conversation.