lumen-generators
lumen-generators copied to clipboard
Should (or could) this just be a development dependency?
Since we should not be generating anything on production, can this package be installed as a dev only dependency?
composer require --dev wn/lumen-generators
I'm asking in case there is any production run-time component of this package that is needed by generated components that I am not aware of.
If it can, then the documentation should probably mention this, since having it in production, I assume, will provide some extra load each request.
At a minimum, the App\Providers\AppServiceProvider
needs to be aware that the package may not be installed.
...
use Wn\Generators\CommandsServiceProvider;
...
class AppServiceProvider extends ServiceProvider
{
public function register()
{
// Install the generators.
if ($this->app->environment() === 'local' && class_exists(CommandsServiceProvider::class)) {
$this->app->register(CommandsServiceProvider::class);
}
}
...
}
Even simpler in bootstrap/app.php
:
if (class_exists(Wn\Generators\CommandsServiceProvider::class)) {
$app->register(Wn\Generators\CommandsServiceProvider::class);
}