Files
pterodactyl-panel/app/Transformers/Api/Client/UserSSHKeyTransformer.php
T

31 lines
691 B
PHP
Raw Normal View History

<?php
2026-10-05 18:10:18 -04:00
declare(strict_types=1);
namespace Pterodactyl\Transformers\Api\Client;
use Pterodactyl\Models\UserSSHKey;
2022-05-14 18:08:48 -04:00
class UserSSHKeyTransformer extends BaseClientTransformer
{
public function getResourceName(): string
{
return UserSSHKey::RESOURCE_NAME;
}
/**
* Return's a user's SSH key in an API response format.
2026-10-05 18:10:18 -04:00
*
* @return ApiPayload
*/
public function transform(UserSSHKey $model): array
{
return [
'name' => $model->name,
'fingerprint' => $model->fingerprint,
'public_key' => $model->public_key,
2026-10-05 18:10:18 -04:00
'created_at' => $this->formatTimestamp($model->created_at),
];
}
}