Composer is the most popular way for managing packages in PHP bases applications. Laravel also relies over composer for installing, upgrading and removing packages. Composer 2.0 is the latest version available for installation. This is more powerful, fast and fully compatible with older versions.
Remove Package from Laravel
You can remove all packages no longer required from the Laravel application. Use the following command to remove the package from vendor. This will also update composer.json and composer.lock accordingly.
composer remove vendor/package
vendor/package with the packages name to delete.
For example, below command will delete
doctrine/annotations from Laravel application.
composer remove doctrine/annotations
That’s it. You may now need to remove all the references added in the application code. The above instructions can be used with any PHP application using composer for removing packages.