Przemek
Przemek

Reputation: 822

voyager - (Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands defined in the "voyager" namespace)

So I am trying to install Voyager for my laravel, but when I insert

php artisan voyager:install

I am getting this error message:

(Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands defined in the "voyager" namespace)

Here is my PhP and Laravel version:

Laravel Framework version 5.3.16

λ php -v PHP 7.0.13 (cli) (built: Nov 8 2016 13:45:28) ( ZTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

And my package service providers:

/* * Package Service Providers... */

TCG\Voyager\VoyagerServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,

So what is the problem? why am I getting this error message

Upvotes: 6

Views: 5215

Answers (3)

Elias Missaoui
Elias Missaoui

Reputation: 9

If you have successfully executed the command line:

composer require tcg/voyager

You must have the line "tcg/voyager": "^1.2" in the require section of your composer.json file, in this case the command line "composer dumpautoload" will automatically perform all the packages discovery for you. Otherwise do the following :

add the line of code: TCG\Voyager\VoyagerServiceProvider::class to the file "config/app.php". Then run the following command line :

composer dumpautoload

Upvotes: 0

Erick Mwazonga
Erick Mwazonga

Reputation: 1300

php artisan config:clear

solved my problem

Upvotes: 0

Alexey Mezenin
Alexey Mezenin

Reputation: 163748

Looks like you didn't install it. Comment out or remove service providers from the list and run these commands:

composer require tcg/voyager
composer dumpauto

According to the docs, next step will be adding a service provider to the config/app.php:

TCG\Voyager\VoyagerServiceProvider::class,

And only then run php artisan voyager:install command.

Upvotes: 1

Related Questions