ldc-arcadia-api/routes/apiv1.php
Jérémy Munsch b2c11a52ad
refactor(api): restructure API routes and improve organization
- Group employee routes under a prefix for better clarity.
- Remove unnecessary blank lines and improve code formatting.
2026-08-13 09:35:09 +02:00

28 lines
878 B
PHP

<?php
declare(strict_types=1);
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Route;
use Presentation\Api\V1\Http\Controllers\Employees\EmployeeShowController;
use Presentation\Api\V1\Http\Controllers\Employees\EmployeesIndexController;
// * ROOT
Route::get('/', fn () => response()->json([
'message' => Config::string('app.name') . ' v1',
'spec' => route('api.v1.openapi'),
]))->name('root');
// * OPENAPI
Route::get('/openapi', function () {
return response()->file(
base_path('documentation/OpenApi/openapi.yaml'),
['Content-Type' => 'application/yaml']
);
})->name('openapi');
// * EMPLOYEES
Route::prefix('employees')->group(function () {
Route::get('/', EmployeesIndexController::class)->name('employees.index');
Route::get('/{employeeId}', EmployeeShowController::class)->name('employees.show');
});