mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-10-26 07:26:51 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			608 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			608 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Transformers\Api\Client;
 | |
| 
 | |
| use App\Models\UserSSHKey;
 | |
| 
 | |
| class UserSSHKeyTransformer extends BaseClientTransformer
 | |
| {
 | |
|     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,
 | |
|             'created_at' => $model->created_at->toAtomString(),
 | |
|         ];
 | |
|     }
 | |
| }
 | 
