diff --git a/app/Http/Controllers/Api/AssetModelsController.php b/app/Http/Controllers/Api/AssetModelsController.php index b788bc167f..5e9b3ad78d 100644 --- a/app/Http/Controllers/Api/AssetModelsController.php +++ b/app/Http/Controllers/Api/AssetModelsController.php @@ -70,6 +70,10 @@ class AssetModelsController extends Controller $assetmodels->onlyTrashed(); } + if ($request->filled('category_id')) { + $assetmodels = $assetmodels->where('models.category_id', '=', $request->input('category_id')); + } + if ($request->filled('search')) { $assetmodels->TextSearch($request->input('search')); } diff --git a/resources/views/categories/view.blade.php b/resources/views/categories/view.blade.php index cbc4d48d64..a37a87616f 100644 --- a/resources/views/categories/view.blade.php +++ b/resources/views/categories/view.blade.php @@ -129,11 +129,13 @@
+ @can('update', \App\Models\AssetModel::class) @if ($category->models->count() > 0) @if ($category->category_type=='asset') @include('partials.models-bulk-actions') @endif @endif + @endcan