Boy132 e1308cb04d
Small api docs improvements (#1032)
* 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>
2025-02-26 16:12:19 +01:00

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();
}
}