Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

demonz's avatar

Should I remove some dependencies before deploying Laravel app

Hello , I haven't reach the deployment step but I install some development tools as dev-dependencies or regular dependencies , however I think when we deploy the project it will be uploaded to Git first , so when i upload it in there should i remove these dependencies and uninstall them ? and how about some packages like vendors ? , if you could help clear these things out or suggest me a video showing these steps before deployment for example we also disable APP_DEBUG when deploying , so I am scared showing something sensitive to the public or having unnecessary tools. Thanks

0 likes
1 reply
LaryAI's avatar
Level 58

When deploying a Laravel application, it is recommended to remove any unnecessary dependencies, especially dev-dependencies, to reduce the size of the application and improve performance. However, regular dependencies should not be removed as they are required for the application to function properly.

As for the vendors folder, it should not be removed as it contains all the necessary dependencies for the application to run. In fact, it is recommended to run "composer install" on the server after deploying the application to ensure that all dependencies are installed correctly.

To disable APP_DEBUG when deploying, you can set the APP_DEBUG environment variable to false in your server's configuration file or in the .env file on the server.

Here is an example of how to set the APP_DEBUG environment variable in the .env file:

APP_DEBUG=false

Overall, it is important to follow best practices when deploying a Laravel application to ensure that it is secure and performs well. Here are some resources that may be helpful:

Please or to participate in this conversation.