Skip to content

Commit e79af25

Browse files
committed
Added name, model_number and notes for strict search
Signed-off-by: snipe <[email protected]>
1 parent 5b0d7f4 commit e79af25

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

app/Http/Controllers/Api/AssetModelsController.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ public function index(Request $request) : JsonResponse | array
7777
$assetmodels->onlyTrashed();
7878
}
7979

80+
if ($request->filled('name')) {
81+
$assetmodels = $assetmodels->where('models.name', '=', $request->input('name'));
82+
}
83+
84+
if ($request->filled('model_number')) {
85+
$assetmodels = $assetmodels->where('models.model_number', '=', $request->input('model_number'));
86+
}
87+
88+
if ($request->filled('notes')) {
89+
$assetmodels = $assetmodels->where('models.notes', '=', $request->input('notes'));
90+
}
91+
8092
if ($request->filled('category_id')) {
8193
$assetmodels = $assetmodels->where('models.category_id', '=', $request->input('category_id'));
8294
}

0 commit comments

Comments
 (0)