使用下面的代码,它应该上传到$ path中指定的路径,但是由于某种原因,它将所有图片的链接保存到扩展名为.tmp的c:\ xampp \ tmp中,但会将它们移动到正确的文件夹中无论如何。我做错了什么?
public function store(Request $request){
//
if($file = $request->file('image')){
$name = $file->getClientOriginalName();
$path = 'public/images';
if($file->move($path, $name)){
$post = new Gallery();
$post->image = $request->image;
$post->name = $request->name;
$post->species_id = $request->species_id;
$post->tag = $request->tag;
$post->patreon = $request->tag;
$post->save();
return redirect()->route('admin.gallery.index');
};
};
}