From d8ded29c2adaecc1e099429279d48ecf7b753023 Mon Sep 17 00:00:00 2001 From: stazrouti Date: Mon, 16 Sep 2024 13:07:40 +0100 Subject: [PATCH] api routes --- rental-car-backend/routes/api.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 rental-car-backend/routes/api.php diff --git a/rental-car-backend/routes/api.php b/rental-car-backend/routes/api.php new file mode 100644 index 0000000..2e2ac7c --- /dev/null +++ b/rental-car-backend/routes/api.php @@ -0,0 +1,20 @@ +user(); +})->middleware('auth:sanctum'); +Route::get('/test', function () { + return response()->json(['message' => 'API is working']); +}); + +Route::get('cars', [CarController::class, 'index']); +Route::post('cars', [CarController::class, 'store']); +Route::get('cars/{id}', [CarController::class, 'show']); +Route::put('cars/{id}', [CarController::class, 'update']); +Route::delete('cars/{id}', [CarController::class, 'destroy']); +/* Route::middleware('auth:sanctum')->group(function () { */ +/* }); */ \ No newline at end of file