From 1d7e243d0ad18819886b4688897025f1d1efe5f3 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 22 Aug 2017 15:02:31 -0700 Subject: [PATCH] Fixes #3790 - parent display on locations index --- app/Http/Transformers/LocationsTransformer.php | 5 ++++- resources/views/locations/index.blade.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Http/Transformers/LocationsTransformer.php b/app/Http/Transformers/LocationsTransformer.php index 44c75664da..f463108d03 100644 --- a/app/Http/Transformers/LocationsTransformer.php +++ b/app/Http/Transformers/LocationsTransformer.php @@ -44,7 +44,10 @@ class LocationsTransformer 'assets' => $assets_arr, 'created_at' => Helper::getFormattedDateObject($location->created_at, 'datetime'), 'updated_at' => Helper::getFormattedDateObject($location->updated_at, 'datetime'), - 'parent_id' => ($location->parent_id) ? (int) $location->parent_id : null, + 'parent' => ($location->parent) ? [ + 'id' => (int) $location->parent->id, + 'name'=> e($location->parent->name) + ] : null, 'children' => $children_arr, ]; diff --git a/resources/views/locations/index.blade.php b/resources/views/locations/index.blade.php index 72a2946377..8720291ee1 100755 --- a/resources/views/locations/index.blade.php +++ b/resources/views/locations/index.blade.php @@ -29,7 +29,7 @@ {{ trans('general.id') }} {{ trans('admin/locations/table.name') }} - {{ trans('admin/locations/table.parent') }} + {{ trans('admin/locations/table.parent') }} {{ trans('admin/locations/table.assets_rtd') }} {{ trans('admin/locations/table.assets_checkedout') }} {{ App\Models\Setting::first()->default_currency }}