mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-10-31 07:26:52 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			755 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			755 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Http\Controllers\Api\Application\Users;
 | |
| 
 | |
| use App\Models\User;
 | |
| use App\Transformers\Api\Application\UserTransformer;
 | |
| use App\Http\Controllers\Api\Application\ApplicationApiController;
 | |
| use App\Http\Requests\Api\Application\Users\GetExternalUserRequest;
 | |
| 
 | |
| class ExternalUserController extends ApplicationApiController
 | |
| {
 | |
|     /**
 | |
|      * Retrieve a specific user from the database using their external ID.
 | |
|      */
 | |
|     public function index(GetExternalUserRequest $request, string $external_id): array
 | |
|     {
 | |
|         $user = User::query()->where('external_id', $external_id)->firstOrFail();
 | |
| 
 | |
|         return $this->fractal->item($user)
 | |
|             ->transformWith($this->getTransformer(UserTransformer::class))
 | |
|             ->toArray();
 | |
|     }
 | |
| }
 | 
