Added me endpoints

This commit is contained in:
Constantin Graf
2024-07-18 10:00:20 +02:00
committed by Gregor Vostrak
parent 0e7dec2f40
commit 21207a4058
11 changed files with 261 additions and 48 deletions

View File

@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Api\V1;
use App\Http\Resources\V1\User\UserResource;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Http\Resources\Json\JsonResource;
class UserController extends Controller
{
/**
* Get the current user
*
* This endpoint is independent of organization.
*
* @operationId getMe
*
* @throws AuthorizationException
*/
public function me(): JsonResource
{
$user = $this->user();
return new UserResource($user);
}
}