diff --git a/app/Http/Transformers/LocationsTransformer.php b/app/Http/Transformers/LocationsTransformer.php new file mode 100644 index 0000000000..0f6ee437bc --- /dev/null +++ b/app/Http/Transformers/LocationsTransformer.php @@ -0,0 +1,34 @@ + e($location->id), + 'name' => e($location->name) + ]; + return $locations_array; + } + + + } + + + +} diff --git a/app/Http/Transformers/UsersTransformer.php b/app/Http/Transformers/UsersTransformer.php new file mode 100644 index 0000000000..52edf81c31 --- /dev/null +++ b/app/Http/Transformers/UsersTransformer.php @@ -0,0 +1,36 @@ + e($user->id), + 'first_name' => e($user->first_name), + 'last_name' => e($user->last_name), + 'location' => (new LocationsTransformer)->transformLocation($user->userloc), + 'permissions' => $user->decodePermissions(), + 'created_at' => $user->created_at, + 'updated_at' => $user->updated_at, + ]; + + return $user_array; + } + + + +}