From 94c981e22c275c453369ba709e2996d847112f73 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 28 Aug 2024 14:23:49 +0100 Subject: [PATCH] Set image to null if model is deleted Signed-off-by: snipe --- app/Http/Controllers/AssetModelsController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.php index 60b1a39803..94c630c094 100755 --- a/app/Http/Controllers/AssetModelsController.php +++ b/app/Http/Controllers/AssetModelsController.php @@ -202,6 +202,7 @@ class AssetModelsController extends Controller if ($model->image) { try { Storage::disk('public')->delete('models/'.$model->image); + $model->update(['image' => null]); } catch (\Exception $e) { Log::info($e); }