Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update api:install command #10091

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down