From a6bbe1fec3dc245cd7734f1daf56ebc30d4f36eb Mon Sep 17 00:00:00 2001 From: Tom Misilo <1446856+misilot@users.noreply.github.com> Date: Wed, 5 May 2021 00:18:22 -0500 Subject: [PATCH] Delete file from assets folder, not just the ref. (#9525) --- app/Http/Controllers/Assets/AssetFilesController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Assets/AssetFilesController.php b/app/Http/Controllers/Assets/AssetFilesController.php index 28aa3097c5..7cdd075ab9 100644 --- a/app/Http/Controllers/Assets/AssetFilesController.php +++ b/app/Http/Controllers/Assets/AssetFilesController.php @@ -110,15 +110,15 @@ class AssetFilesController extends Controller { $asset = Asset::find($assetId); $this->authorize('update', $asset); - $rel_path = 'storage/private_uploads/assets'; + $rel_path = 'private_uploads/assets'; // the asset is valid if (isset($asset->id)) { $this->authorize('update', $asset); $log = Actionlog::find($fileId); if ($log) { - if (file_exists(base_path().'/'.$rel_path.'/'.$log->filename)) { - Storage::disk('public')->delete($rel_path.'/'.$log->filename); + if (Storage::exists($rel_path.'/'.$log->filename)) { + Storage::delete($rel_path.'/'.$log->filename); } $log->delete(); return redirect()->back()->with('success', trans('admin/hardware/message.deletefile.success'));