How to remove a package from Laravel using composer?

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

    Normally composer remove used like this is enough:

    $ composer remove vendor/package
    

    but if composer package is removed and config cache is not cleaned you cannot clean it, when you try like so

    php artisan config:clear
    

    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

    $rm bootstrap/cache/config.php
    

    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.

提交回复
热议问题