composer install --no-dev fails
Shkryob opened this issue · comments
When I create new Lucid project
composer create-project lucid-arch/laravel test-lucid
and run
cd test-lucid/
composer install --no-dev
It fails with error
In ProviderRepository.php line 208:
Class 'Lucid\Console\LucidServiceProvider' not found
Lucid\Console\LucidServiceProvider class is used in config https://github.com/lucid-architecture/laravel/blob/master/config/app.php#L164
and specified as dev dependency https://github.com/lucid-architecture/laravel/blob/master/composer.json#L21
I expect dev dependencies not to be used in production code and config.
What is preferred way this issue to be solved?
the console's LucidServiceProvider hooks https://github.com/lucid-architecture/console-laravel into the project. It is better to not have it in production to prevent running a console command that might modify something within the code (like create a feature or job or controller) even though not destructive.
You can safely remove the service provider from config/app.php
, it is only used to serve the console's UI, but the rest would still work normally.
@Mulkave I think better approach is to use Laravel package autodiscovery lucidarch/console-laravel#35
This way it will work on all the environments.
I might create a PR for that.
had the same issue. can we get the lucid-architecture/console-laravel#35 merged @Mulkave?
I updated console-laravel to support package discovery here.
To use package discovery, update your dependency of lucid-arch/laravel-console
to ^7.0
and remove Lucid\Console\LucidServiceProvider::class
from your config/app.php
@Mulkave I suggest to close this because it's fixed in the 7.x.