我有一个图片文件在 C:\xampp\htdocs\blog\storage\app\public\images\15201710351.jpg
现在我想使用 Storage
类从图片文件夹中删除它。
$post = Post::find($id);
Storage::delete(storage_path().'app/public/images/'.$post->image);
而且(and with)
Storage::delete(storage_path('app/public/images/'.$post->image));
此外还有这个。
Storage::delete(public_path().'/storage/images/'.$post->image);// i have created symbolic link
没有错误信息,但是不起作用。我正在使用laravel 5.6,有人可以帮忙吗?
Storage::delete($path)
似乎只能使用公共桌面上的相对路径。我也曾感到困惑,但现在已经解决了。 - Lamin Barrow