What is the right way to remove a package from Laravel 4? So long I've tried:
- Remove declaration from
composer.json
(in "require" section) - Remove any Class Aliases from
app.php
- Remove any references to the package from my code :-)
- Run
composer update
- Run
composer dump-autoload
Not working! Am I missing something?
Some packages publish their configuration via "artisan config:publish ...". Is there a way to "unpublish" them?
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.
Running the following command
Thats all.No need composer update. Vendor/Package Name is just directory as installed before
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:
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.
Got it working... The steps to remove a package from Laravel are:
It will remove the package folder from "Vendor" folder
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,
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.