Added created_by to API output

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-06-23 17:18:31 -07:00
parent 23c50ea9a5
commit 7f05029089

View file

@ -63,6 +63,10 @@ class UsersTransformer
'accessories_count' => (int) $user->accessories_count,
'consumables_count' => (int) $user->consumables_count,
'company' => ($user->company) ? ['id' => (int) $user->company->id, 'name'=> e($user->company->name)] : null,
'created_by' => ($user->adminuser) ? [
'id' => (int) $user->adminuser->id,
'name'=> e($user->adminuser->present()->fullName),
] : null,
'created_at' => Helper::getFormattedDateObject($user->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($user->updated_at, 'datetime'),
'last_login' => Helper::getFormattedDateObject($user->last_login, 'datetime'),