Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Transformers/Api/Client/ApiKeyTransformer.php
10284 views
1
<?php
2
3
namespace Pterodactyl\Transformers\Api\Client;
4
5
use Pterodactyl\Models\ApiKey;
6
7
class ApiKeyTransformer extends BaseClientTransformer
8
{
9
public function getResourceName(): string
10
{
11
return ApiKey::RESOURCE_NAME;
12
}
13
14
/**
15
* Transform this model into a representation that can be consumed by a client.
16
*/
17
public function transform(ApiKey $model): array
18
{
19
return [
20
'identifier' => $model->identifier,
21
'description' => $model->memo,
22
'allowed_ips' => $model->allowed_ips,
23
'last_used_at' => $model->last_used_at ? $model->last_used_at->toAtomString() : null,
24
'created_at' => $model->created_at->toAtomString(),
25
];
26
}
27
}
28
29