What is the correct way to remove a package from Laravel using PHP Composer?
So far I've tried:
- Remove declaration from file composer.json (in the "require" section)
- Remove any class aliases from file app.php
- Remove any references to the package from my code 🙂
- Run
composer update
- Run
composer dump-autoload
None of these options are working! What am I missing?
Best Answer
Composer 1.x and 2.x
Running the following command will remove the package from vendor (or wherever you install packages), composer.json and composer.lock. Change vendor/package appropriately.
Obviously you'll need to remove references to that package within your app.
I'm currently running the following version of Composer:
Documentation
https://getcomposer.org/doc/03-cli.md#remove-rm
Updates
remove-rm
documentation