Dev dependencies in production

Just a general disclaimer, we recommend not enabling dev dependencies on production servers for best practices reasons.

Though, sometimes, you may want to enable dev dependencies on your server for whatever reason. For Laravel projects, you can do so by enabling the ‘Composer dev dependency’ deployment hook to run during deployment.


If you run across the ‘install Composer dependencies’ step failing in deployment; take a look at the log. If you something such as

@php artisan ide-helper:generate
There are no commands defined in the "ide-helper" namespace.  
Script @php artisan ide-helper:generate handling the post-autoload-dump event returned with error code 1

then you may have a script where a dev dependency is being sought. For best practices, we’d recommend to update your project to make it production ready and avoid relying on development related dependencies. The error above, for example, was a dependency used by Laravel debugger.