Home » Laravel Remove Package With Example (Correct Way)

Laravel Remove Package With Example (Correct Way)

Last updated on January 6, 2021 by

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:

  1. At the very first step, Remove the providers declaration from the config/app.php file.
  2. If you have added the aliases then remove it from config/app.php file. Please check below screenshot.
laravel remove package
Removing Service Provider and Aliases from config/app.php
  1. Next, If you have added your package references in Controllers, Models, Routes, or any other file then remove it.
  2. If you have published any vendor-related files then manually delete them. Ignore is you haven’t run any vendor:publish command.
  3. 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

We have 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:

  1. Laravel One To One Relationship Tutorial
  2. Laravel One To Many Relationship Tutorial With Example
  3. Database Records Update In Laravel
  4. Best Way to Remove Public from URL in Laravel
  5. Error After php artisan config:cache In Laravel
  6. Specified Key Was Too Long Error In Laravel
  7. AJAX PHP Post Request With Example
  8. How To Use The Laravel Soft Delete
  9. How To Add Laravel Next Prev Pagination
  10. How To Print Or Debug Query In Laravel
  11. Difference Between Factory And Seeders In Laravel
  12. Laravel: Increase Quantity If Product Already Exists In Cart
  13. Laravel DataTables Tutorial With Example
  14. Laravel Send Mail From Localhost
  15. How To Convert Word To PDF In Laravel
  16. 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!


4 thoughts on “Laravel Remove Package With Example (Correct Way)”

  1. Exϲellent beat ! I wiѕh t᧐ apprentice whіle you amend your website, how сan i subscrіbe for a blog weƅѕite?

    The account hеlped mе a acceptable deal. I had been a little
    bit acquainted of thіs your broadcast provided bright clear concept

  2. Pingback: URL

Leave a Comment