From 16f4753b59e47ede1c98c133d69a7f092a514844 Mon Sep 17 00:00:00 2001 From: amir Date: Sun, 29 Dec 2024 01:40:33 +0330 Subject: [PATCH] update api:install command --- routing.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routing.md b/routing.md index 3fda01168d..6fcf7dc826 100644 --- a/routing.md +++ b/routing.md @@ -67,6 +67,10 @@ The `install:api` command installs [Laravel Sanctum](/docs/{{version}}/sanctum), return $request->user(); })->middleware('auth:sanctum'); +Alternatively, you may choose to install [Laravel Passport](/docs/{{version}}/passport) by utilizing the --passport command option. Passport provides a full OAuth2 server implementation. When using Passport, the generated routes/api.php file will utilize the auth:api middleware: + + ->middleware('auth:api'); + The routes in `routes/api.php` are stateless and are assigned to the `api` [middleware group](/docs/{{version}}/middleware#laravels-default-middleware-groups). Additionally, the `/api` URI prefix is automatically applied to these routes, so you do not need to manually apply it to every route in the file. You may change the prefix by modifying your application's `bootstrap/app.php` file: ->withRouting(