Laravel 8 删除文件
delete
方法接收一个文件名或一个文件名数组来将其从磁盘中删除:
use Illuminate\Support\Facades\Storage;
Storage::delete('file.jpg');
Storage::delete(['file.jpg', 'file2.jpg']);
如果有必要,您可以指定删除的文件的磁盘:
use Illuminate\Support\Facades\Storage;
Storage::disk('s3')->delete('folder_path/file_name.jpg');