拉拉维尔删除包与作曲家



我试图从我的laravel安装中删除barryvdh/laravel-debugbar,但似乎我没有做对。

到目前为止我做了什么:

  • composer remove barryvdh/laravel-debugbar
  • 然后我删除了配置/应用程序中的引用.php

我有一个错误:

[RuntimeException]
Error Output: PHP Fatal error:
Class 'BarryvdhDebugbarServiceProvider' not found in 
{mypath}vendorlaravelframeworksrcIlluminateFoundationProviderRepository.php on line 146

我尝试了转储自动加载,清除编译,但没有一个有效。

我错过了什么?


22/

02/2016 编辑 : 我还尝试删除所有vendor文件夹,然后通过 composer install 再次安装,但是当命令php artisan clear-compiled运行 angain 时,我再次收到错误。

好的,看来我已经玩过工匠命令,并且配置文件被缓存(通过 php artisan config:cache (。

我删除了它(在bootstrap/cache/config.php中(,一切都像一个魅力,但我也可以使用命令php artisan config:clear删除它。

当你安装调试栏时,在通过作曲家安装包后,你需要在config/app.php中将类添加到providers数组中。所以你需要从那里删除这一行:

BarryvdhDebugbarServiceProvider::class

如果还注册了外观,则需要从同一文件的aliases数组中删除以下内容:

'Debugbar' => BarryvdhDebugbarFacade::class

如果您还运行了php artisan vendor:publish(这是软件包自述文件中安装部分中描述的最后一步(,那么您也可以删除config/debugbar.php文件,尽管保留该配置文件不会导致任何问题。

Marc Brillault的回答是正确的。我正在为这个答案添加更多澄清:

我手动从 catch 文件中删除了调试栏类。 存在于 ( bootstrap/cache/config.php 中(。

如何删除手动类的步骤。

1.) Open this two files 
   `bootstrap/cache/config.php`
   `config/app.php`
2.) Find this two line and remove It.        
    BarryvdhDebugbarServiceProvider::class,
   'Debugbar' => BarryvdhDebugbarFacade::class,
3.) run command `php artisan config:clear`

完成此步骤后,检查命令php artisan list运行良好。

您必须:

第一。删除对配置/应用程序中调试栏的引用.php

第二,作曲家删除Barryvdh/Laravel-Debugbar

按此顺序。如果你不这样做,拉拉维尔会感到困惑;)

您需要做的最好的方法是手动删除所有作曲家文件中的所有文件。

最新更新