2018-06-06 06:00:01 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Transformers\Api\Client;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\User;
|
|
|
|
|
|
|
|
class AccountTransformer extends BaseClientTransformer
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Return the resource name for the JSONAPI output.
|
|
|
|
*/
|
|
|
|
public function getResourceName(): string
|
|
|
|
{
|
|
|
|
return 'user';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return basic information about the currently logged in user.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function transform(User $model)
|
|
|
|
{
|
|
|
|
return [
|
2018-06-07 05:49:44 +00:00
|
|
|
'id' => $model->id,
|
2018-06-06 06:00:01 +00:00
|
|
|
'admin' => $model->root_admin,
|
|
|
|
'username' => $model->username,
|
|
|
|
'email' => $model->email,
|
|
|
|
'language' => $model->language,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|