Are you looking for the correct way to remove the Laravel package? Yes! then you are the perfect place. In this article, we will see Laravel remove package with proper examples. Are you ready guys? Let’s dive into it.
Laravel Remove Package Using Composer
Let’s suppose, you have already installed the spatie/laravel-permission 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:
- At the very first step, Remove the
providersdeclaration from the
- If you have added the
aliasesthen remove it from
config/app.phpfile. Please check below screenshot.
- Next, If you have added your package references in Controllers, Models, Routes, or any other file then remove it.
- If you have published any vendor-related files then manually delete them. Ignore is you haven’t run any
- At last run, the following command with your vendor and package name to remove the package from the vendor folder, and you are done.
composer remove vendor/packagename
spatie as a vendor and the package name is
laravel-permission. So we can remove the Laravel package as below:
composer remove spatie/laravel-permission php artisan config:clear // Remove the configuration cache
Additionally, read our guide:
- Laravel One To One Relationship Tutorial
- Laravel One To Many Relationship Tutorial With Example
- Database Records Update In Laravel
- Best Way to Remove Public from URL in Laravel
- Error After php artisan config:cache In Laravel
- Specified Key Was Too Long Error In Laravel
- AJAX PHP Post Request With Example
- How To Use The Laravel Soft Delete
- How To Add Laravel Next Prev Pagination
- How To Print Or Debug Query In Laravel
- Difference Between Factory And Seeders In Laravel
- Laravel: Increase Quantity If Product Already Exists In Cart
- Laravel DataTables Tutorial With Example
- Laravel Send Mail From Localhost
- How To Convert Word To PDF In Laravel
- Laravel Multiple Where Conditions With Example
That’s it for now. We hope this article helped you to learn Laravel package remove with example.
Please let us know in the comments if everything worked as expected, your issues, or any questions. If you think this article saved your time & money, please do comment, share, like & subscribe. Thank you in advance. 🙂 Keep Smiling! Happy Coding!