I don't understand correct way for use barryvdh/laravel-ide-helper only on develop mode.
If use method on his help, get error on production because composer.json call artisan command not valid
help & doc
To install this package on only development systems, add the --dev flag to your composer command:
composer require --dev barryvdh/laravel-ide-helper
In Laravel, instead of adding the service provider in the config/app.php file, you can add the following code to your app/Providers/AppServiceProvider.php file, within the register() method:
public function register()
{
if ($this->app->environment() !== 'production') {
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
}
// ...
}
But on composer.json
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan ide-helper:generate",
"php artisan ide-helper:meta",
"php artisan optimize"
]
If run composer update --no-dev or composer updateget error
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan ide-helper:generate
[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "ide-helper" namespace.
Script php artisan ide-helper:generate handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output:
Where is mistake? There're any way for use composer.json with two way, one for production and other for development?
Apreciate help