Add support for finding a user by external ID.
This commit is contained in:
parent
2e693067b8
commit
a9c1946319
7 changed files with 91 additions and 6 deletions
|
@ -0,0 +1,23 @@
|
|||
<?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
|
||||
* @return array
|
||||
*/
|
||||
public function index(GetExternalUserRequest $request): array
|
||||
{
|
||||
return $this->fractal->item($request->getUserModel())
|
||||
->transformWith($this->getTransformer(UserTransformer::class))
|
||||
->toArray();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue