mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-03 05:56:52 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
		
			849 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			849 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace Pterodactyl\Transformers\Api\Client;
 | 
						|
 | 
						|
use Pterodactyl\Models\ApiKey;
 | 
						|
 | 
						|
class ApiKeyTransformer extends BaseClientTransformer
 | 
						|
{
 | 
						|
    /**
 | 
						|
     * {@inheritdoc}
 | 
						|
     */
 | 
						|
    public function getResourceName(): string
 | 
						|
    {
 | 
						|
        return ApiKey::RESOURCE_NAME;
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Transform this model into a representation that can be consumed by a client.
 | 
						|
     *
 | 
						|
     * @param \Pterodactyl\Models\ApiKey $model
 | 
						|
     * @return array
 | 
						|
     */
 | 
						|
    public function transform(ApiKey $model)
 | 
						|
    {
 | 
						|
        return [
 | 
						|
            'identifier' => $model->identifier,
 | 
						|
            'description' => $model->memo,
 | 
						|
            'allowed_ips' => $model->allowed_ips,
 | 
						|
            'last_used_at' => $model->last_used_at ? $model->last_used_at->toIso8601String() : null,
 | 
						|
            'created_at' => $model->created_at->toIso8601String(),
 | 
						|
        ];
 | 
						|
    }
 | 
						|
}
 |