PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, March 7, 2022

[FIXED] How to uninstall Laravel Passport

 March 07, 2022     composer-php, laravel     No comments   

Issue

I've decided to use JWT and completely remove Laravel Passport from the project.

I was trying to start with composer remove laravel/passport. However, it does no good:

  [Symfony\Component\Debug\Exception\FatalThrowableError]
  Class 'Laravel\Passport\Passport' not found


Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

Removal failed, reverting ./composer.json to its original content.

What could be the right and safe removing procedure?


Solution

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

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

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

  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


Answered By - Paul Santos
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing