Skip to content

Commit

Permalink
add reservation endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
stazrouti committed Sep 19, 2024
1 parent 88b20d5 commit cbc747e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rental-car-backend/routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 () { */
/* }); */

0 comments on commit cbc747e

Please sign in to comment.