api(application): v2 backport
This commit is contained in:
parent
4cd0bee231
commit
67bf3e342e
172 changed files with 2922 additions and 1579 deletions
29
app/Transformers/Api/Application/AdminRoleTransformer.php
Normal file
29
app/Transformers/Api/Application/AdminRoleTransformer.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?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,
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue