disable laravel passport

Solutions on MaxInterview for disable laravel passport by the best coders in the world

showing results for - "disable laravel passport"
Mea
10 Mar 2016
1You can remove passport by manually deleting this line "laravel/passport": "^4.0" 
2in your composer.json file then run composer update. Or composer remove laravel/passport
3
4If you're running Laravel 5.4 or below, make sure to remove this line in 
5your app.config file Laravel\Passport\PassportServiceProvider::class
6
7And all classes that relies on passport must be edited as well. 
8The most common classes are:
9
101) User model, remove the HasApiToken trait.
112) AuthServiceProvider, remove Passport::routes(); in your boot method.
123) Your config/auth.php, change your driver option for api authentication
13
14php artisan migrate:refresh run at the end of step. 
15To remove the Passport Migrations in database migrations table. 
16but please be careful in you are in production.
17
18
19
20
21
22With Laravel 7
23
24Step 1. In the file app/Providers/AuthServiceProvider.php, remove these two lines:
25
26use Laravel\Passport\Passport;
27Passport::routes();
28Step 2.
29
30$ composer remove laravel/passport
31$ rm -r ./resources/js/components/passport # if any
32$ rm -r ./resources/views/vendor/passport # if any
33Step 3. In the file resources/js/app.js, remove passport components registration. You may also find and remove these registered components if you used it somewhere:
34
35$ grep -rn 'passport-authorized-clients'     resources/js/*
36$ grep -rn 'passport-personal-access-tokens' resources/js/*
37$ grep -rn 'passport-clients'                resources/js/*
38Step 4. Find and remove HasApiTokens from your models:
39
40$ grep -rn HasApiTokens * 
41Remove also the import line going with it:
42
43use Laravel\Passport\HasApiTokens;
44Step 5. Remove oauth keys
45
46$ rm storage/oauth-*.key
47Step 6. In the file config/auth.php, look for guards:api:driver and revert from passport to token.
48
49Step 7. Drop Passport tables and clean migration table
50
51$ php artisan tinker
52>>> Schema::drop('oauth_access_tokens');
53>>> Schema::drop('oauth_auth_codes');
54>>> Schema::drop('oauth_clients');
55>>> Schema::drop('oauth_personal_access_clients');
56>>> Schema::drop('oauth_refresh_tokens');
57>>> DB::table('migrations')->where('migration', 'like', '%_oauth_access_tokens_table')->delete();
58>>> DB::table('migrations')->where('migration', 'like', '%_oauth_auth_codes_table')->delete();
59>>> DB::table('migrations')->where('migration', 'like', '%_oauth_clients_table')->delete();
60>>> DB::table('migrations')->where('migration', 'like', '%_oauth_personal_access_clients_table')->delete();
61>>> DB::table('migrations')->where('migration', 'like', '%_oauth_refresh_tokens_table')->delete();
62>>> exit
63
64Step 8. And finally, refresh your installation:
65
66$ composer dump-autoload
67$ php artisan optimize:clear
68$ npm run dev
69
70
71
72https://stackoverflow.com/questions/47567249/how-to-uninstall-laravel-passport