- Group employee routes under a prefix for better clarity. - Remove unnecessary blank lines and improve code formatting.
28 lines
878 B
PHP
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');
|
|
});
|