A free open source IT asset/license management system
Fixed issue where consumables model number was not searchable
snipe9687bcb41c16
diff --git a/app/Http/Controllers/Api/ConsumablesController.php b/app/Http/Controllers/Api/ConsumablesController.phpindex 44fe602159..f4c9da3df8 100644--- a/app/Http/Controllers/Api/ConsumablesController.php+++ b/app/Http/Controllers/Api/ConsumablesController.php@@ -42,6 +42,10 @@ class ConsumablesController extends Controller$consumables->where('category_id','=',$request->input('category_id'));}+ if ($request->filled('model_number')) {+ $consumables->where('model_number','=',$request->input('model_number'));+ }+if ($request->filled('manufacturer_id')) {$consumables->where('manufacturer_id','=',$request->input('manufacturer_id'));}diff --git a/app/Models/Consumable.php b/app/Models/Consumable.phpindex 14de8c6ebb..65214961fc 100644--- a/app/Models/Consumable.php+++ b/app/Models/Consumable.php@@ -78,7 +78,7 @@ class Consumable extends SnipeModel** @var array*/- protected $searchableAttributes = ['name', 'order_number', 'purchase_cost', 'purchase_date', 'item_no'];+ protected $searchableAttributes = ['name', 'order_number', 'purchase_cost', 'purchase_date', 'item_no', 'model_number'];/*** The relations and their attributes that should be included when searching the model.