feat: update

This commit is contained in:
Azerothwav 2025-01-27 11:46:54 +01:00
parent ada96d5410
commit 23ff31fdeb
3 changed files with 16 additions and 5 deletions

View File

@ -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"}'
```

View File

@ -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']);

View File

@ -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']);