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

kekekiw123's avatar

Disable or remove packages from prod server

I wonder if there is a way to disable or remove packages from laravel when deploying to a live server.

Eg: I have Faker and laravel debug bar installed when developing my app. Can I somehow remove them and all their files before I deploy?

I dont want my vendor map or Laravel app to swell up with packages that arent used on live server

0 likes
2 replies
michaeldyrynda's avatar

Matt Stauffer wrote about conditionally loading service providers in Laravel 5 on his blog recently.

Two things - you'll want to make packages you don't want in prod part of your dev dependencies, then register those service providers in your AppServiceProvider as @khoanguyenme suggests above.

Please or to participate in this conversation.