How to Remove Composer Package in Laravel with Example
Author: Syed Arshad Sultan
Hi Developers,
In this tutorial, I will discuss how to remove composer package in Laravel.
Here, I will give you very simple step to remove composer package from Laravel application. you can use this step for remove composer package in laravel 6, laravel 7, laravel 8, laravel 9 and laravel 10 version.
In this example we will install dompdf composer package with following command:
composer require barryvdh/laravel-dompdf
If you installed by misteck above package then we can remove it by following step.
UnInstall Composer Package:
Remove providers and aliases
If you added providers and aliases for your composer package then you have to remove it as bellow screen shot:

Remove Package using Command:
Here bellow command to remove composer package. so let’s see bellow syntax and command for remove dompdf package:
Syntax:
composer remove package_name
Example:
composer remove barryvdh/laravel-dompdf
Remove Config File:
Now we have to run following command to clear config file. so let’s run as bellow:
php artisan config:clear
Thank you for reading this article.