How to Remove Package In Laravel ?

Laravel 8 , Laravel 7 , Laravel , Laravel 6

Nicesnippets

1292

12-06-2021


Hi Guys,

In this example, I will learn you how to remove package in laravel.you can easy and simply remove package in laravel.

you have already installed the yajra/laravel-datatables-oracle but after some time you felt that this package is not helpful as per your project requirement. Now you want to remove this Laravel package in the correct way. To do so follow the following steps:

Step 1.


At the very first step, Remove the providers declaration from the config/app.php file

Step 2.

If you have added the aliases then remove it from config/app.php file. Please check below screenshot.

Step 3.

Next, If you have added your package references in Controllers, Models, Routes, or any other file then remove it.

Step 4.

If you have published any vendor-related files then manually delete them. Ignore is you haven’t run any vendor:publish command.

Step 5.

At last run, the following command with your vendor and package name to remove the package from the vendor folder, and you are done.

Syntax:

composer remove vendor/packagename

We have yajra as a vendor and the package name is laravel-datatables-oracle. So we can remove the Laravel package as below:

composer remove yajra/laravel-datatables-oracle

php artisan config:clear

It will help you...