33 lines
746 B
PHP
33 lines
746 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 AdminRole 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,
|
|
];
|
|
}
|
|
}
|