There are no commands defined in the “passport” na

2019-01-28 04:42发布

问题:

I am getting below error when i run php artisan passport:install

[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "passport" namespace.

回答1:

For installing laravel passport make sure you add this line to config/app.php in the providers array (package service providers section):

Laravel\Passport\PassportServiceProvider::class,

Then install the package and migrate the database

composer require laravel/passport
php artisan migrate 
php artisan passport:install

Clearing out the cache is generally helpful first step when commands are not working, especially when you update anything in the config folder on .env files.

php artisan config:clear  
php artisan config:cache 

Config clear removes the configuration cache file. Config cache creates a new configuration cache file with the current settings. Config cache enables faster load times for your apps!



回答2:

I got solution. After running following two commands every thing work fine.

run php artisan cache:clear
run php artisan config:cach


标签: laravel-5