misc_pterodactyl-panel/app/Transformers/Api/Application/AdminRoleTransformer.php

30 lines
668 B
PHP
Raw Permalink Normal View History

2022-12-15 00:05:46 +00:00
<?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,
];
}
}