How to Remove Package from Laravel (Composer)

Composer is the most popular way to manage packages in PHP-based applications. Laravel also relies on his Composer to install, update, and remove packages. Composer 2.0 is the latest version available for installation. It’s more powerful, faster, and fully compatible with older versions.

Remove Package from Laravel

You can remove any packages that are no longer required by the Laravel application. To remove the package from the vendor, use the following command. This will update composer.json and composer.lock as well.

composer remove vendor/package

Change vendor/package the package’s name to delete.

For example, the below command will delete intervention/image from the Laravel application.

composer remove intervention/image

that’s it. You may need to remove any references added to your application code. The above steps can be used for any PHP application that uses Composer to remove packages.