Files
pterodactyl-panel/app/Transformers/Api/Admin/ServerVariableTransformer.php
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

30 lines
723 B
PHP

<?php
declare(strict_types=1);
namespace Pterodactyl\Transformers\Api\Admin;
use Pterodactyl\Models\EggVariable;
use Pterodactyl\Models\ServerVariable;
use Pterodactyl\Support\JsonValueGuard;
class ServerVariableTransformer extends BaseAdminTransformer
{
public function getResourceName(): string
{
return ServerVariable::RESOURCE_NAME;
}
/** The server variables relation resolves to EggVariable models carrying the server-specific value. */
/**
* @return ApiPayload
*/
public function transform(EggVariable $variable): array
{
$attributes = $variable->attributesToArray();
JsonValueGuard::assertPayload($attributes);
return $attributes;
}
}