From 23ff31fdebbb2f3b14d331ed4d142442ad15cfbb Mon Sep 17 00:00:00 2001 From: Azerothwav Date: Mon, 27 Jan 2025 11:46:54 +0100 Subject: [PATCH] feat: update --- README.md | 15 +++++++++++++++ routes/api.php | 4 ---- routes/web.php | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e69de29..8d16151 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,15 @@ +# Installation du projet Laravel REST API + +## Installation du support api + +``` +php artisan install:api +``` + +Executer les migrations une fois le support installer. + +## Requete CURL pour créer un article + +``` +curl -X POST http://192.168.56.56/api/articles -H "Content-Type: application/json" -d '{"titre":"Mon titre","contenu":"Contenu de l article"}' +``` diff --git a/routes/api.php b/routes/api.php index 3cfb8a0..69b842c 100644 --- a/routes/api.php +++ b/routes/api.php @@ -3,10 +3,6 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; -Route::get('/user', function (Request $request) { - return $request->user(); -})->middleware('auth:sanctum'); - use App\Http\Controllers\Api\ArticleController; Route::post('/articles', [ArticleController::class, 'store']); diff --git a/routes/web.php b/routes/web.php index 2686ca1..7a1dd8b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -7,7 +7,7 @@ Route::get('/', function () { }); use App\Http\Controllers\Api\ArticleController; -// + Route::get('articles', [ArticleController::class, 'index']); // Route::post('articles', [ArticleController::class, 'store']); // Route::get('articles/{id}', [ArticleController::class, 'show']);