feat: update
This commit is contained in:
parent
ada96d5410
commit
23ff31fdeb
15
README.md
15
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"}'
|
||||
```
|
@ -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']);
|
||||
|
@ -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']);
|
||||
|
Loading…
x
Reference in New Issue
Block a user