我上传图像的代码如下:
$file = $file->move($path, $fileName);
代码有效
但我想使用 Storage::put 来改变它,就像这个参考:
https://laravel.com/docs/5.6/filesystem#storing-files
我尝试这样:
Storage::put($fileName, $path);
它不起作用
我很困惑,我必须把$file
代码放在哪里
我怎么解决这个问题?
更新:
$file = file of image
$path = storage_path('/app/public/product/')
$fileName = chelsea.jpg
所以我想将名为 chelsea.jpg 的文件保存在/app/public/product/