Skip to content
Advertisement

IlluminateConsoleCommand not found when developing laravel 5.8 package

I am developing a package for Laravel 5.8. When I try to create a console command that extends IlluminateConsoleCommand then “composer dump-autoload” fails with error message:

JavaScript

I have tried to create the package by hand inside of C:Program Files (x86)Amppswwwptestpackages folder and I tried to use the packager https://github.com/Jeroen-G/laravel-packager but the result is identical in both cases.

TestCommand.php

JavaScript

TestServiceProvider.php

JavaScript

When I execute the TestCommand.php file directly from command line it fails with the error message

JavaScript

I have checked other working packages inside “Vendor” folder and all have the same structure as my package. It seems as if autoloading does not work properly.

Advertisement

Answer

The “console” folder was outside of “src” folder. Therefore it could not be discovered.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement