misc_pterodactyl-panel/app/Transformers/Api/Client/SubuserTransformer.php

23 lines
498 B
PHP
Raw Normal View History

2019-11-03 20:20:11 +00:00
<?php
namespace Pterodactyl\Transformers\Api\Client;
use Pterodactyl\Models\Subuser;
use Pterodactyl\Transformers\Api\Transformer;
2019-11-03 20:20:11 +00:00
class SubuserTransformer extends Transformer
2019-11-03 20:20:11 +00:00
{
public function getResourceName(): string
{
return Subuser::RESOURCE_NAME;
}
public function transform(Subuser $model): array
2019-11-03 20:20:11 +00:00
{
return array_merge(
(new UserTransformer())->transform($model->user),
['permissions' => $model->permissions]
);
2019-11-03 20:20:11 +00:00
}
}