2018-02-08 03:56:11 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Controllers\Api\Application\Users;
|
|
|
|
|
|
|
|
use Pterodactyl\Transformers\Api\Application\UserTransformer;
|
|
|
|
use Pterodactyl\Http\Controllers\Api\Application\ApplicationApiController;
|
|
|
|
use Pterodactyl\Http\Requests\Api\Application\Users\GetExternalUserRequest;
|
|
|
|
|
|
|
|
class ExternalUserController extends ApplicationApiController
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Retrieve a specific user from the database using their external ID.
|
|
|
|
*
|
|
|
|
* @param \Pterodactyl\Http\Requests\Api\Application\Users\GetExternalUserRequest $request
|
2021-01-01 22:55:30 +00:00
|
|
|
*
|
2018-02-08 03:56:11 +00:00
|
|
|
* @return array
|
2021-01-01 22:55:30 +00:00
|
|
|
* @throws \Illuminate\Contracts\Container\BindingResolutionException
|
2018-02-08 03:56:11 +00:00
|
|
|
*/
|
|
|
|
public function index(GetExternalUserRequest $request): array
|
|
|
|
{
|
|
|
|
return $this->fractal->item($request->getUserModel())
|
|
|
|
->transformWith($this->getTransformer(UserTransformer::class))
|
|
|
|
->toArray();
|
|
|
|
}
|
|
|
|
}
|