Horizon: Command "horizon" is not defined.

Created on 12 Aug 2017  路  6Comments  路  Source: laravel/horizon

Here is the steps I do:

composer require laravel/horizon
php artisan vendor:publish --provider="Laravel\Horizon\HorizonServiceProvider"
cp vendor/laravel/horizon/config/horizon.php config/
Then I execute
php artisan horizon
it show me the error:
[Symfony\Component\Console\Exception\CommandNotFoundException]
  Command "horizon" is not defined.

Here is the logs:

#0 /var/www/laravel-stock-calc/vendor/symfony/console/Application.php(209): Symfony\Component\Console\Application->find('horizon')
#1 /var/www/laravel-stock-calc/vendor/symfony/console/Application.php(130): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /var/www/laravel-stock-calc/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/www/laravel-stock-calc/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 {main}
[2017-08-12 14:30:01] local.ERROR: Symfony\Component\Console\Exception\CommandNotFoundException: Command "horizon" is not defined. in /var/www/laravel-stock-calc/vendor/symfony/console/Application.php:584
Stack trace:
#0 /var/www/laravel-stock-calc/vendor/symfony/console/Application.php(209): Symfony\Component\Console\Application->find('horizon')
#1 /var/www/laravel-stock-calc/vendor/symfony/console/Application.php(130): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /var/www/laravel-stock-calc/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/www/laravel-stock-calc/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 {main}
[2017-08-12 14:30:22] local.ERROR: Symfony\Component\Console\Exception\CommandNotFoundException: Command "horizon" is not defined. in /var/www/laravel-stock-calc/vendor/symfony/console/Application.php:584
Stack trace:
#0 /var/www/laravel-stock-calc/vendor/symfony/console/Application.php(209): Symfony\Component\Console\Application->find('horizon')
#1 /var/www/laravel-stock-calc/vendor/symfony/console/Application.php(130): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /var/www/laravel-stock-calc/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/www/laravel-stock-calc/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 {main}

Most helpful comment

@terryzwt add this line to your config/app.php in laravel 5.4 project

You need to add a record in providers array.
Laravel\Horizon\HorizonServiceProvider::class,

After this run php artisan vendor:publish --provider="Laravel\Horizon\HorizonServiceProvider"
Then run php artisan horizon.

It should be up and running.

All 6 comments

Are you using horizon with Laravel 5.5?

Laravel Framework 5.4.32

See #32. There are no plans to support < 5.5.

If horizon only support laravel >= 5.5, why not put the dependency in the composer.josn file?

@terryzwt add this line to your config/app.php in laravel 5.4 project

You need to add a record in providers array.
Laravel\Horizon\HorizonServiceProvider::class,

After this run php artisan vendor:publish --provider="Laravel\Horizon\HorizonServiceProvider"
Then run php artisan horizon.

It should be up and running.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wturrell picture wturrell  路  5Comments

etiennellipse picture etiennellipse  路  3Comments

slavarazum picture slavarazum  路  3Comments

rossuhms picture rossuhms  路  5Comments

mahdiahmadi73 picture mahdiahmadi73  路  3Comments