mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 23:54:44 +02:00

* update scramble * cleanup application api endpoints * cleanup client api endpoints * fix security schema and make docs homepage nicer * remove duplicate myclabs/deep-copy * style(api-docs): use Blade template and Tailwind for styling * Publish scramble view * Use localStorage theme instead of config * Update routes/docs.php Co-authored-by: Lance Pioch <git@lance.sh> --------- Co-authored-by: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Co-authored-by: RMartinOscar <40749467+RMartinOscar@users.noreply.github.com> Co-authored-by: Lance Pioch <git@lance.sh>
28 lines
884 B
PHP
28 lines
884 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api\Application\Servers;
|
|
|
|
use App\Models\Server;
|
|
use App\Transformers\Api\Application\ServerTransformer;
|
|
use App\Http\Controllers\Api\Application\ApplicationApiController;
|
|
use App\Http\Requests\Api\Application\Servers\GetExternalServerRequest;
|
|
use Dedoc\Scramble\Attributes\Group;
|
|
|
|
#[Group('Server', weight: 1)]
|
|
class ExternalServerController extends ApplicationApiController
|
|
{
|
|
/**
|
|
* View server (external id)
|
|
*
|
|
* Retrieve a specific server from the database using its external ID.
|
|
*/
|
|
public function index(GetExternalServerRequest $request, string $external_id): array
|
|
{
|
|
$server = Server::query()->where('external_id', $external_id)->firstOrFail();
|
|
|
|
return $this->fractal->item($server)
|
|
->transformWith($this->getTransformer(ServerTransformer::class))
|
|
->toArray();
|
|
}
|
|
}
|