How to remove a package from Laravel using the composer?

Do you know how to remove a package from laravel? You are at the right place .. you can add and remove laravel package with a single command . a

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.

You can find more laravel tutorials here .. 

As conclusion we so we can simply add and remove packages to a laravel application via using composer. having a package manager like Composer is always helpful for programmers like us.

Post Your Questions on our forum

Post a question on Forum

Ajith Jojo Joseph

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

Share with your friends:

Leave a Reply

Your email address will not be published.

How to get data from a model on all pages in Laravel – Simple Way

Do you know How to get data from a model on all pages in Laravel ? In this blog post, […]

August 5, 2022

How to create a Laravel Collection From JSON

Today i have to create a laravel collection from a JSON object. I search on the internet and I cant […]

August 3, 2022

Laravel Eloquent WhereNull() and whereNotNull() Example

Do you know how to use WhereNull() and whereNotNull() Laravel Eloquent. In this post, I will explain how to use […]

July 28, 2022

Laravel Array to JSON Response From Laravel Controller

Do you know how to make JSON responses from a Laravel array? As a developer someday we all have to […]

July 28, 2022

Digital Marketing Toolkit

Get Free Access to Digital Marketing Toolkit. You can use all our tools without any limits

Get Free Access Now