且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何卸载 Laravel Passport

更新时间:2023-12-04 10:26:46

您可以通过在 composer 中手动删除此行 "laravel/passport": "^4.0" 来删除护照.json 文件,然后运行 ​​composer update.

You can remove passport by manually deleting this line "laravel/passport": "^4.0" in your composer.json file then run composer update.

如果您运行的是 Laravel 5.4 或更低版本,请确保在您的 app.config 文件 LaravelPassportPassportServiceProvider::class

If you're running Laravel 5.4 or below, make sure to remove this line in your app.config file LaravelPassportPassportServiceProvider::class

所有依赖护照的课程也必须进行编辑.最常见的类是:

And all classes that relies on passport must be edited as well. The most common classes are:

  1. User 模型,移除 HasApiToken 特征.
  2. AuthServiceProvider,在你的启动方法中移除 Passport::routes();.
  3. 您的 config/auth.php,更改 api 身份验证的驱动程序选项
  1. User model, remove the HasApiToken trait.
  2. AuthServiceProvider, remove Passport::routes(); in your boot method.
  3. Your config/auth.php, change your driver option for api authentication