mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 18:04:46 +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
858 B
PHP
28 lines
858 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;
|
|
use Dedoc\Scramble\Attributes\Group;
|
|
|
|
#[Group('User', weight: 1)]
|
|
class ExternalUserController extends ApplicationApiController
|
|
{
|
|
/**
|
|
* View user (external id)
|
|
*
|
|
* 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();
|
|
}
|
|
}
|