From cbc747e073e0414a76440d408c0eeb55e97181ca Mon Sep 17 00:00:00 2001 From: stazrouti Date: Thu, 19 Sep 2024 23:01:39 +0100 Subject: [PATCH] add reservation endpoints --- rental-car-backend/routes/api.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rental-car-backend/routes/api.php b/rental-car-backend/routes/api.php index 2e2ac7c..6190d96 100644 --- a/rental-car-backend/routes/api.php +++ b/rental-car-backend/routes/api.php @@ -16,5 +16,17 @@ Route::get('cars/{id}', [CarController::class, 'show']); Route::put('cars/{id}', [CarController::class, 'update']); Route::delete('cars/{id}', [CarController::class, 'destroy']); + +use App\Http\Controllers\Api\ReservationController; + +// API routes for reservations +Route::prefix('reservations')->group(function () { + Route::get('/', [ReservationController::class, 'index']); // List all reservations + Route::post('/', [ReservationController::class, 'store']); // Create a new reservation + Route::get('/{reservation}', [ReservationController::class, 'show']); // Show a specific reservation + Route::put('/{reservation}', [ReservationController::class, 'update']); // Update a specific reservation + Route::delete('/{reservation}', [ReservationController::class, 'destroy']); // Delete a specific reservation +}); + /* Route::middleware('auth:sanctum')->group(function () { */ /* }); */ \ No newline at end of file