From d9fa2f0e91d413b05639dc72af2fea64a15b7c5d Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 16 Jul 2018 21:50:14 -0700 Subject: [PATCH] Fixed #5842 - added components to location detail view --- .../Controllers/Api/ComponentsController.php | 4 +++ resources/views/locations/view.blade.php | 35 +++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/app/Http/Controllers/Api/ComponentsController.php b/app/Http/Controllers/Api/ComponentsController.php index 00b4cd9e5a..987d30da2e 100644 --- a/app/Http/Controllers/Api/ComponentsController.php +++ b/app/Http/Controllers/Api/ComponentsController.php @@ -39,6 +39,10 @@ class ComponentsController extends Controller $components->where('category_id','=',$request->input('category_id')); } + if ($request->has('location_id')) { + $components->where('location_id','=',$request->input('location_id')); + } + $offset = request('offset', 0); $limit = request('limit', 50); diff --git a/resources/views/locations/view.blade.php b/resources/views/locations/view.blade.php index 9e3975a61a..932765dfc1 100644 --- a/resources/views/locations/view.blade.php +++ b/resources/views/locations/view.blade.php @@ -86,6 +86,41 @@ + +
+
+
+

{{ trans('general.components') }}

+
+
+
+
+ + + +
+
+
+
+ +