text: How to remove a package from Laravel using composer? - Stack Overflow
  What is the correct way to remove a package from Laravel using composer? So far I've tried:
  Remove any references to the package from my code :-)
  None of these options are working! What am I missing?
  edited Sep 27 '20 at 8:31
  asked Apr 17 '14 at 6:59
  9,95544 gold badges2121 silver badges2525 bronze badges
  Composer 1.x and 2.x
  Obviously you'll need to remove references to that package within your app.
  I'm currently running the following version of composer:
  26/10/2020 - Updated answer to assert command works for v1.x and v2.x of Composer
  edited Oct 26 '20 at 9:08
  10.4k22 gold badges2121 silver badges3434 bronze badges
  @ZeshanKhattak composer update will update all dependencies. It way leave the project in unstable state. Don't use composer update unless you want to update dependencies – zarax Apr 26 '17 at 14:05
  composer remove packagename , It updates removing package from composer.json and removes package folder from vendor... laravel - 5.4.24, composer - 1.4.2. – user4318530 Jun 9 '17 at 11:18
  It seems like composer is automatically installing missing packages after running composer remove <package>. Anyway to avoid that? Using version 1.7.2. – Olle Härstedt Aug 31 '18 at 12:50
  it should be: composer remove package_name instead: composer remove vendor/package there is no need of vendor as laravel automatically check in vendor directory for packages. – prashant Sep 13 '19 at 10:01
  If you don't want your packages to be updated after removing a module you can run composer install instead of composer update – Gezzasa Jul 13 '20 at 10:15
  Got it working... The steps to remove a package from Laravel are:
  Remove Service Provider from config/app.php (reference in "providers" array)
  Remove any Class Aliases from config/app.php
  Remove any references to the package from your code :-)
  Run composer update vendor/package-name. This will remove the package folder from the vendor folder and will rebuild the composer autoloading map.
  Manually delete the published files (read the comment by zwacky)
  It will remove the package folder from Vendor folder
  edited Jul 29 '20 at 2:43
  although unpublishing assets/configs isn't really an automated thing. i usually delete manually the vendor/package folders in config/ or public/. – Simon Wicki Apr 17 '14 at 7:28
  now laravel should come up with something like "remove package <package-name>" to make it easier. – Chandan Gupta Oct 8 '14 at 14:08
  A problem with this solution is that it will update all other packages, which may not be what you want. – tremby Nov 19 '15 at 21:53
  (1) and (5) can be replaced with running composer remove vendor/package, I think. – JCarlosR Sep 6 '17 at 19:31
  Thank you, this instructions was useful to remove not working Igaster/laravel-theme package – Jjsg08 Nov 16 '18 at 15:21
  That's all. No need composer update. Vendor/Package Name is just directory as installed before
  edited Jul 4 '19 at 13:43
  Riaj FerdousRiaj Ferdous
  I did this and it says that its no longer required in composer.json so 'ignoring' – Sweet Chilly Philly Jan 5 '19 at 21:01
  composer remove <packageName> I think this one is perfect for removing any packages. Forget about Vendor :) For example, composer remove laravel/tinker – Shamsul Huda Feb 10 '20 at 15:00
  laravel is the vendor and tinker is the package name. you can't just remove a package by calling composer remove tinker. – Lajos Mészáros Mar 22 at 13:46
  Normally composer remove used like this is enough:
  but if composer package is removed and config cache is not cleaned you cannot clean it, when you try like so
  you can get an error In ProviderRepository.php line 208:
  Class 'Laracasts\Flash\FlashServiceProvider' not found
  this is a dead end, unless you go deleting files
  And this is Laravel 5.6 I'm talking about, not some kind of very old stuff.
  It happens usually on automated deployment, when you copy files of a new release on top of old cache. Even if you cleared cache before copying. You end up with old cache and a new composer.json.
  edited Sep 23 '18 at 21:56
  answered Sep 16 '18 at 23:23
  I think it is fixed in 5.7 – Yevgeniy Afanasyev Jan 15 '19 at 4:19
  With 5.6, my bootstrap/cache was empty. I forgot that I'd changed the cache path (config/cache.php)! Deleting the files in the new cache folder fixed the problem! – Aine Jan 29 '19 at 14:13
  @YevgeniyAfanasyev This is not fixed Even in 5.7 – Shreyansh Panchal Mar 2 '19 at 10:50
  I almost spent 3 hours pulling my hairs out over this. I thought config:clear would fix this. – Shreyansh Panchal Apr 2 '19 at 13:28
  you can remove any package just by typing follwing command in terminal, and just remove the providers and alias you provided at the time of installing the package, if any and update the composer,
  1,96411 gold badge1818 silver badges1818 bronze badges
  Sometimes to update the new dependancies, you have to update the composer. I think there is no harm in running that. – Shahrukh Anwar Jul 16 '18 at 7:33
  Before removing a package from composer.json declaration, please remove cache
  If you forget to remove cache and you get class not found error then please reinstall the package and clear cache and remove again.
  edited Jan 31 '18 at 17:20
  1,58611 gold badge1818 silver badges3838 bronze badges
  1,3171818 silver badges1616 bronze badges
  Simpliest and Easiest way
  1,06122 gold badges99 silver badges2222 bronze badges
  You can do any one of the below two methods:
  Running the below command (most recommended way to remove your package without updating your other packages)
  Go to your composer.json file and then run command like below it will remove your package (but it will also update your other packages)
  3,56522 gold badges2929 silver badges4040 bronze badges
  If you are still getting the error after you have done with all above steps, go to your projects bootstrap->cache->config.php remove the provider & aliases entries from the cached array manually.
  This helped me. – Peter Griffin Jun 1 '18 at 7:57
  Some package vendor does not meet all requirements to create a package. For that reason, these vendors composer remove vendor/package unable to remove the cache entries properly. So, @Ramjith Ap is absolutely correct here. – Samrat Khan Nov 12 '18 at 19:18
  use "composer remove vendor/package"
  ** This is Example: Install / Add Pakage
  Uninsall / Remove
  Finaly after removing:
  edited Mar 6 '19 at 7:40
  You can remove any package by typing following command in terminal, and just remove the providers and alias you provided at the time of installing the package and update the composer
  If you are using composer update to remove package folder, it is not necessary as package source directory is deleted during the removal process. – Gucu112 Aug 6 '20 at 5:45
  To remove a package using composer command
  To install a package using composer command
  To install all packages which are mentioned in composer.json
  To update packages
  I used these for Laravel project
  6341111 silver badges2626 bronze badges
  In case the given answers still don't help you remove that, try this:
  Manually delete the line in require from composer.json
  Remove the package with
  you can check remove package from composer.json - docs
  Or you can remove the package name from composer.json file and run composer update from within your project directory. I hope it helps.
  edited Apr 19 '20 at 11:44
  answered Feb 2 '20 at 7:25
  We have come with a great solution. This solution is practically done in Laravel 6. If you want to remove any package from your Laravel Project then you can easily remove the package by following below steps:
  Step 1: You must know the package name which you want to remove. If you don't know complete package name then you can open your project folder and go to composer.json file and check name in require an array
  Suppose, here I am going to remove "fideloper/proxy" package.
  Step 2: Open command prompt with your project root folder directory Step 3: First of all clear all cache by following commands. Run commands one by one.
  Step 4: Now write the following command to remove the package. Here you need to change your package name instead of my example package.
  Now, wait for a few seconds your package is removing.
  answered Feb 3 '20 at 21:33
  1,4091515 silver badges1717 bronze badges
  or composer remove laravel/telescope --dev if it is dev package – vinsa Mar 23 '20 at 14:03
  On laravel 8.* I following steps work for me :
  Run command composer remove package-name on terminal
  Remove Provider and aliases from Config/app.php
  Remove related file from Config folder.
  Remove from your code where you used .
  Remove package folder from vendor folder (Manual delete)
  remove it from 'composer.json' & 'composer.lock' files (use ctrl+f5 to search )
  remove it from 'config/app.php' & 'bootstrap/cache/config.php' files
  run this commads:
  composer remove your-package-name
  php artisan cache:clear & php artisan config:clear
  There are quite a few steps here:
  Go to composer.json and look for the package and how it is written over there.
  I wish to remove twig 3.0
  Now open cmd and run composer remove vendor/your_package_name as composer remove twig/twig this will remove the package.
  As a final step run composer update this will surely give you a massage of nothing to install or update but this is important in case your packages have inter-dependencies.
  When adding an answer to six year old question with an accepted answer and fifteen existing answers it is important to point out what new aspect of the question your answer addresses. – Jason Aller Aug 20 '20 at 23:24
  The most important thing I faced is point No.3, which we often ignore as we usually get "nothing to install or update", I was unfortunate while uninstalling certain illuminate component as I had sentinel which uses illuminate capsule. however thankfully update composer command helped here. the answers above misses on the inter-dependencies part, in case you feel its not important juss reply back I will remove my answer. – Chandraarnav Aug 21 '20 at 5:19
  Not the answer you're looking for? Browse other questions tagged laravel laravel-4 package composer-php uninstallation or ask your own question.