How to remove a package from Laravel using composer?

前端 未结 16 1883
[愿得一人]
[愿得一人] 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:58

    To remove a package using composer command

    composer remove <package>
    

    To install a package using composer command

    composer require <package>
    

    To install all packages which are mentioned in composer.json

    composer install
    

    To update packages

    composer update
    

    I used these for Laravel project

    0 讨论(0)
  • 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

    0 讨论(0)
  • 2020-11-28 18:02

    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,

    composer remove vendor/your_package_name
    composer update
    
    0 讨论(0)
  • 2020-11-28 18:02

    Before removing a package from composer.json declaration, please remove cache

    php artisan cache:clear  
    php artisan config:clear 
    

    If you forget to remove cache and you get class not found error then please reinstall the package and clear cache and remove again.

    0 讨论(0)
  • 2020-11-28 18:02

    **

    use "composer remove vendor/package"

    ** This is Example: Install / Add Pakage

    composer require firebear/importexportfree
    

    Uninsall / Remove

    composer remove firebear/importexportfree
    

    Finaly after removing:

    php -f bin/magento setup:upgrade
    
    php bin/magento setup:static-content:deploy –f
    
    php bin/magento indexer:reindex 
    
    php -f bin/magento cache:clean
    
    0 讨论(0)
  • 2020-11-28 18:03

    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

    composer remove <package_name>
    composer update
    
    0 讨论(0)
提交回复
热议问题