Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon What database migrations are created by the install:api command for Passport


What database migrations are created by the install:api command for Passport


When you run the `php artisan install:api --passport` command in Laravel 11, it creates the following database migrations for Laravel Passport:

1. `create_users_table`: This migration creates the `users` table, which is used to store user information. It includes columns like `name`, `email`, `password`, and timestamps.

2. `create_password_resets_table`: This migration creates the `password_resets` table, which is used to store password reset tokens.

3. `create_failed_jobs_table`: This migration creates the `failed_jobs` table, which is used to store failed jobs for the queue system.

4. `create_personal_access_clients_table`: This migration creates the `personal_access_clients` table, which is used to store personal access clients for Passport.

5. `create_oauth_auth_codes_table`: This migration creates the `oauth_auth_codes` table, which is used to store OAuth2 authorization codes.

6. `create_oauth_access_tokens_table`: This migration creates the `oauth_access_tokens` table, which is used to store OAuth2 access tokens.

7. `create_oauth_refresh_tokens_table`: This migration creates the `oauth_refresh_tokens` table, which is used to store OAuth2 refresh tokens.

8. `create_oauth_clients_table`: This migration creates the `oauth_clients` table, which is used to store OAuth2 clients.

These migrations are necessary for Passport to function properly and store the required data for OAuth2 authentication.

Citations:
[1] https://laravel.com/docs/11.x/passport
[2] https://github.com/laravel/framework/issues/51144
[3] https://www.toptal.com/laravel/passport-tutorial-auth-user-access
[4] https://artisan.page/11.x/installapi
[5] https://blog.logrocket.com/laravel-passport-a-tutorial-and-example-build/