From 5e4a3379a954b35888133ca2e6f72b879de432db Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Thu, 1 Feb 2024 01:35:25 -0600 Subject: [PATCH] Adds Components and Licenses logs to Assets history view --- app/Http/Controllers/Api/ReportsController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/ReportsController.php b/app/Http/Controllers/Api/ReportsController.php index 5c6eaebf50cc..a91d8a9bccf2 100644 --- a/app/Http/Controllers/Api/ReportsController.php +++ b/app/Http/Controllers/Api/ReportsController.php @@ -33,7 +33,12 @@ public function index(Request $request) if (($request->filled('item_type')) && ($request->filled('item_id'))) { $actionlogs = $actionlogs->where('item_id', '=', $request->input('item_id')) - ->where('item_type', '=', 'App\\Models\\'.ucwords($request->input('item_type'))); + ->where('item_type', '=', 'App\\Models\\'.ucwords($request->input('item_type'))) + ->orWhere(function($query) use ($request) + { + $query->where('target_id', '=', $request->input('item_id')) + ->where('target_type', '=', 'App\\Models\\'.ucwords($request->input('item_type'))); + }); } if ($request->filled('action_type')) {