2021-07-17 17:47:07 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Transformers\Api\Client;
|
|
|
|
|
2021-07-18 17:28:14 +00:00
|
|
|
use Pterodactyl\Models\WebauthnKey;
|
2021-08-07 20:06:45 +00:00
|
|
|
use Pterodactyl\Transformers\Api\Transformer;
|
2021-07-17 17:47:07 +00:00
|
|
|
|
2021-08-07 20:06:45 +00:00
|
|
|
class WebauthnKeyTransformer extends Transformer
|
2021-07-17 17:47:07 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Return the resource name for the JSONAPI output.
|
|
|
|
*/
|
|
|
|
public function getResourceName(): string
|
|
|
|
{
|
2021-08-07 20:06:45 +00:00
|
|
|
return WebauthnKey::RESOURCE_NAME;
|
2021-07-17 17:47:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return basic information about the currently logged in user.
|
|
|
|
*/
|
|
|
|
public function transform(WebauthnKey $model): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'id' => $model->id,
|
|
|
|
'name' => $model->name,
|
2021-08-07 20:06:45 +00:00
|
|
|
'created_at' => self::formatTimestamp($model->created_at),
|
2021-07-17 17:47:07 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|