Add API endpoint to get a server by external ID
This commit is contained in:
parent
a1e704d3a7
commit
fb1b2406b5
4 changed files with 82 additions and 0 deletions
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Http\Controllers\Api\Application\Servers;
|
||||
|
||||
use Pterodactyl\Transformers\Api\Application\ServerTransformer;
|
||||
use Pterodactyl\Http\Controllers\Api\Application\ApplicationApiController;
|
||||
use Pterodactyl\Http\Requests\Api\Application\Servers\GetExternalServerRequest;
|
||||
|
||||
class ExternalServerController extends ApplicationApiController
|
||||
{
|
||||
/**
|
||||
* Retrieve a specific server from the database using its external ID.
|
||||
*
|
||||
* @param \Pterodactyl\Http\Requests\Api\Application\Servers\GetExternalServerRequest $request
|
||||
* @return array
|
||||
*/
|
||||
public function index(GetExternalServerRequest $request): array
|
||||
{
|
||||
return $this->fractal->item($request->getServerModel())
|
||||
->transformWith($this->getTransformer(ServerTransformer::class))
|
||||
->toArray();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue