misc_pterodactyl-panel/app/Transformers/Api/Application/AdminRoleTransformer.php
2021-01-01 15:55:30 -07:00

33 lines
741 B
PHP

<?php
namespace Pterodactyl\Transformers\Api\Application;
use Pterodactyl\Models\AdminRole;
class AdminRoleTransformer extends BaseTransformer
{
/**
* Return the resource name for the JSONAPI output.
*
* @return string
*/
public function getResourceName(): string
{
return AdminRole::RESOURCE_NAME;
}
/**
* Return a transformed User model that can be consumed by external services.
*
* @param \Pterodactyl\Models\AdminRole $model
* @return array
*/
public function transform(AdminRole $model): array
{
return [
'id' => $model->id,
'name' => $model->name,
'description' => $model->description,
];
}
}