misc_pterodactyl-panel/app/Transformers/Api/Client/UserSSHKeyTransformer.php

28 lines
667 B
PHP
Raw Normal View History

<?php
namespace Pterodactyl\Transformers\Api\Client;
use Pterodactyl\Models\UserSSHKey;
2022-12-15 00:05:46 +00:00
use Pterodactyl\Transformers\Api\Transformer;
2022-12-15 00:05:46 +00:00
class UserSSHKeyTransformer extends Transformer
{
public function getResourceName(): string
{
return UserSSHKey::RESOURCE_NAME;
}
/**
* Return's a user's SSH key in an API response format.
*/
public function transform(UserSSHKey $model): array
{
return [
'name' => $model->name,
'fingerprint' => $model->fingerprint,
'public_key' => $model->public_key,
2022-12-15 00:05:46 +00:00
'created_at' => self::formatTimestamp($model->created_at),
];
}
}