mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-04 13:25:47 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
31 lines
732 B
PHP
31 lines
732 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Pterodactyl\Transformers\Api\Admin;
|
|
|
|
use Pterodactyl\Models\Subuser;
|
|
|
|
class SubuserTransformer extends BaseAdminTransformer
|
|
{
|
|
public function getResourceName(): string
|
|
{
|
|
return Subuser::RESOURCE_NAME;
|
|
}
|
|
|
|
/**
|
|
* @return ApiPayload
|
|
*/
|
|
public function transform(Subuser $subuser): array
|
|
{
|
|
return [
|
|
'id' => $subuser->id,
|
|
'user_id' => $subuser->user_id,
|
|
'server_id' => $subuser->server_id,
|
|
'permissions' => $subuser->permissions,
|
|
'created_at' => $this->formatTimestamp($subuser->created_at),
|
|
'updated_at' => $this->formatTimestamp($subuser->updated_at),
|
|
];
|
|
}
|
|
}
|