Skip to content

Commit

Permalink
api routes
Browse files Browse the repository at this point in the history
  • Loading branch information
stazrouti committed Sep 16, 2024
1 parent a0d903d commit d8ded29
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions rental-car-backend/routes/api.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\CarController;

Route::get('/user', function (Request $request) {
return $request->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 () { */
/* }); */

0 comments on commit d8ded29

Please sign in to comment.