How to remove a package from Laravel using the composer?

How to use frameworks should be familiar to every PHP developer. By simplifying common practices used in the development of major web projects, such as packages, modules, plug-ins, and even components, frameworks help make the development process easier.

The primary way of adding features to Laravel is to add a package or packages. They may be anything from a nice way to work with dates such as Carbon, an entire BDD testing system such as Behat, or a package that enables users to add to their application a developer toolbar that is used primarily for debugging purposes such as Debugbar.

Adding a package to Laravel
Let’s first add an example package to our Laravel website, which we will later use as an example package to remove.

We are going to use the Laravel Sitemap package. To install the package, just use the following composer command:

composer require themsaid/wink

This will automatically add the following entry in your composer.json file:

“themsaid/wink”: “^5.8”

And will download the package files in the vendor/themsaid/wink folder.

Now that we have added a package, we can use it as an example and remove it.

Removing a package from Laravel using composer
To remove a Laravel package, we just need to run a single command:

composer remove themsaid/wink


Change the themsaid/wink with the name of the package that you want to remove.

This will remove the line from your compser.json file and also the files from the vendor folder.

Don’t forget that you have to edit your code and ensure that the package is not being used.


Share with your friends:

Ajith Jojo Joseph

Self taught, dedicated young entrepreneur with many licensed products under his sleeve. Passionate about technology, business and excellence in general.

HTML Form to Email Using JavaScript and SMTP server 🚀

Hello Everyone, 🙋‍♂️ In this tutorial, we are going to look at how to send emails from HTML Form to […]

22 September, 2021

How to make pretty URL in PHP using .htaccess

Hello Everyone, Here in this tutorial, you will learn How to make a pretty URL in PHP using .htaccess. and […]

18 September, 2021

Submit Form Without Refreshing Page PHP and Javascript

Hello Everyone, In this tutorial, we are going to learn, How to submit a form without reloading. yeah, that’s so […]

HTML from to Email using SMTP in PHP with Source code

Hello Everyone, In this tutorial, I am going to teach you how to send an email from an HTML form […]

16 September, 2021


Subscribe to our weekly Newsletter and stay tuned.

Free PHP Invoicing Software

Gmax CRM Lite is an Invoicing and project management tool for small businesses, features including client management , invoicing , quotation and project management

Download for free