Fixed issue where consumables model number was not searchable

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2021-08-20 17:30:35 -07:00
parent ff8faab3be
commit 9687bcb41c
2 changed files with 5 additions and 1 deletions

View file

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

View file

@ -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.