Merge pull request from snipe/bug/sc-26717-model-delete

Set image to null if model is deleted
This commit is contained in:
snipe 2024-08-28 14:26:03 +01:00 committed by GitHub
commit 26f28a862a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}