mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-03 21:05:45 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
37 lines
826 B
PHP
37 lines
826 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
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 ApiPayload
|
|
*/
|
|
public function transform(User $model): array
|
|
{
|
|
return [
|
|
'id' => $model->id,
|
|
'admin' => $model->root_admin,
|
|
'username' => $model->username,
|
|
'email' => $model->email,
|
|
'first_name' => $model->name_first,
|
|
'last_name' => $model->name_last,
|
|
'language' => $model->language,
|
|
];
|
|
}
|
|
}
|