misc_pterodactyl-panel/app/Transformers/Api/Application/AdminRoleTransformer.php
2022-12-14 17:05:46 -07:00

29 lines
668 B
PHP

<?php
namespace Pterodactyl\Transformers\Api\Application;
use Pterodactyl\Models\AdminRole;
use Pterodactyl\Transformers\Api\Transformer;
class AdminRoleTransformer extends Transformer
{
/**
* Return the resource name for the JSONAPI output.
*/
public function getResourceName(): string
{
return AdminRole::RESOURCE_NAME;
}
/**
* Transform admin role into a representation for the application API.
*/
public function transform(AdminRole $model): array
{
return [
'id' => $model->id,
'name' => $model->name,
'description' => $model->description,
];
}
}