From b223630f721b1c9a210c76efe549c732bc6d1ba4 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 23 May 2017 02:48:03 -0700 Subject: [PATCH] Added dept to User API transformer --- app/Http/Transformers/UsersTransformer.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Transformers/UsersTransformer.php b/app/Http/Transformers/UsersTransformer.php index eb791a23a1..e93c6f2b69 100644 --- a/app/Http/Transformers/UsersTransformer.php +++ b/app/Http/Transformers/UsersTransformer.php @@ -32,6 +32,10 @@ class UsersTransformer 'groups' => $user->groups, 'jobtitle' => e($user->jobtitle), 'email' => e($user->email), + 'department' => ($user->department) ? [ + 'id' => (int) $user->department->id, + 'name'=> e($user->department->name) + ] : null, 'location' => (new LocationsTransformer)->transformLocation($user->userloc), 'permissions' => $user->decodePermissions(), 'activated' => ($user->activated =='1') ? true : false,