mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 07:34:45 +02:00

* Not found property rule * Make these “better” * Day 1 * Day 2 * Day 3 * Dat 4 * Remove disabled check * Day 4 continued * Run pint * Final changes hopefully * Pint fixes * Fix again * Reset these * Update app/Filament/Admin/Pages/Health.php Co-authored-by: MartinOscar <40749467+rmartinoscar@users.noreply.github.com> * Update app/Traits/CheckMigrationsTrait.php Co-authored-by: MartinOscar <40749467+rmartinoscar@users.noreply.github.com> --------- Co-authored-by: MartinOscar <40749467+rmartinoscar@users.noreply.github.com>
30 lines
891 B
PHP
30 lines
891 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.
|
|
*
|
|
* @return array<mixed>
|
|
*/
|
|
public function index(GetExternalUserRequest $request, string $externalId): array
|
|
{
|
|
$user = User::query()->where('external_id', $externalId)->firstOrFail();
|
|
|
|
return $this->fractal->item($user)
|
|
->transformWith($this->getTransformer(UserTransformer::class))
|
|
->toArray();
|
|
}
|
|
}
|