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 create Laravel Flash Messages

Laravel flash messages are a convenient way to display one-time notifications to the user after a form submission or other […]

December 22, 2022

How to make Custom Artisan Command in Laravel

Custom Artisan commands are a useful feature of Laravel that allow you to define your own command-line commands for tasks […]

December 22, 2022

Tips for Laravel migrations

Laravel migrations are a powerful tool for managing and modifying your database schema in a structured and organized way. Here […]

December 22, 2022

Tricks and tips for Laravel blade templating

Welcome to our blog about tricks and tips for Laravel blade templating! Blade is the default templating engine for Laravel, […]

December 22, 2022

Digital Marketing Toolkit

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

Get Free Access Now