我制作了一个可以正常工作的控制器:
public function gallerystore(Request $request){
$gallery_path = 'uploads';
$files = $request->file('gallery');
foreach ($files as $gallery) {
$gallery_new_name = time().$gallery->getClientOriginalName();
$gallery->move($gallery_path, $gallery_new_name);
$img = Image::make(public_path($gallery_path . '/' .$gallery_new_name));
$img->resize(null, 720, function($constraint){
$constraint->aspectRatio();
});
}
}
问题是当我尝试使用Dropzone.js
. 实际上,当我将类dropzone添加到表单中时。Laravel 显示错误
为 foreach() 提供的参数无效。