我正在使用FilePond进行图像上传.它为上传的图像生成随机字符串,并以数组的形式保存在数据库中.
我try 执行以下操作,它会删除记录,但不会删除与其关联的文件.
Since it's an array, I tried this:个
foreach($this->attachments as $attachment) {
if(File::exists(storage_path($attachment))) {
Storage::delete($attachment);
}
}
我还try 了这个:
if(Storage::exists($this->attachments))
{
Storage::delete($this->attachments);
}
注: 我使用Filament作为管理仪表板.
这些文件将在storage/app/public/vehicle-images
保存
我做了php artisan storage:link
次,所以公共文件夹显示``Public/store/Vehicle-Images```