Add endpoints to return a server's egg configuration
This commit is contained in:
parent
5df46b23d2
commit
67ff67a1bd
10 changed files with 309 additions and 106 deletions
30
app/Transformers/Api/Client/EggTransformer.php
Normal file
30
app/Transformers/Api/Client/EggTransformer.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Transformers\Api\Client;
|
||||
|
||||
use Pterodactyl\Models\Egg;
|
||||
|
||||
class EggTransformer extends BaseClientTransformer
|
||||
{
|
||||
/**
|
||||
* Return the resource name for the JSONAPI output.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getResourceName(): string
|
||||
{
|
||||
return Egg::RESOURCE_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Pterodactyl\Models\Egg $egg
|
||||
* @return array
|
||||
*/
|
||||
public function transform(Egg $egg)
|
||||
{
|
||||
return [
|
||||
'uuid' => $egg->uuid,
|
||||
'name' => $egg->name,
|
||||
];
|
||||
}
|
||||
}
|
Reference in a new issue