我正在尝试将filp/whoops
软件包集成到Laravel 5.1应用程序中。
像这样安装包:
composer require filp/whoops:~1.0
像这样创建app/Providers/ErrorServiceProvider.php
:
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Whoops\Handler\PrettyPageHandler;
use Whoops\Run;
class ErrorServiceProvider extends ServiceProvider {
public function boot()
{
$whoops = new Run;
$whoops->pushHandler(new PrettyPageHandler);
$whoops->register();
}
public function register()
{
//
}
}
并在config/app.php
注册了服务提供商,如下所示:
'providers' => [
App\Providers\ErrorServiceProvider::class
]
但我仍然看到默认的错误页面。
答案 0 :(得分:0)
运行composer dump-autoload然后你的问题解决了