How to remove a package from Laravel using composer?

前端 未结 16 1970
[愿得一人]
[愿得一人] 2020-11-28 17:10

What is the correct way to remove a package from Laravel using composer? So far I\'ve tried:

  1. Remove declaration from composer.json (in "requir
16条回答
  •  北海茫月
    2020-11-28 17:59

    Got it working... The steps to remove a package from Laravel are:

    1. Remove declaration from composer.json (in "require" section)
    2. Remove Service Provider from config/app.php (reference in "providers" array)
    3. Remove any Class Aliases from config/app.php
    4. Remove any references to the package from your code :-)
    5. Run composer update vendor/package-name. This will remove the package folder from the vendor folder and will rebuild the composer autoloading map.
    6. Manually delete the published files (read the comment by zwacky)

    It will remove the package folder from Vendor folder

提交回复
热议问题