From bee680683d5de65c4d668b81af33348293751fcc Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 22 Aug 2023 17:05:06 -0700 Subject: [PATCH] Add withTrashed to asset model query --- app/Http/Transformers/ActionlogsTransformer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Transformers/ActionlogsTransformer.php b/app/Http/Transformers/ActionlogsTransformer.php index 2a592e9c83..0a5910259a 100644 --- a/app/Http/Transformers/ActionlogsTransformer.php +++ b/app/Http/Transformers/ActionlogsTransformer.php @@ -159,8 +159,8 @@ class ActionlogsTransformer unset($clean_meta['location_id']); } if(array_key_exists('model_id', $clean_meta)) { - $clean_meta['model_id']['old'] = "[id: ".$clean_meta['model_id']['old']."] ".AssetModel::find($clean_meta['model_id']['old'])->name; - $clean_meta['model_id']['new'] = "[id: ".$clean_meta['model_id']['new']."] ".AssetModel::find($clean_meta['model_id']['new'])->name; /* model is required at asset creation */ + $clean_meta['model_id']['old'] = "[id: ".$clean_meta['model_id']['old']."] ".AssetModel::withTrashed()->find($clean_meta['model_id']['old'])->name; + $clean_meta['model_id']['new'] = "[id: ".$clean_meta['model_id']['new']."] ".AssetModel::withTrashed()->find($clean_meta['model_id']['new'])->name; /* model is required at asset creation */ $clean_meta['Model'] = $clean_meta['model_id']; unset($clean_meta['model_id']); } @@ -183,4 +183,4 @@ class ActionlogsTransformer -} \ No newline at end of file +}