Laravel Debugbar消息未显示 [英] Laravel Debugbar messages not showing

查看:366
本文介绍了Laravel Debugbar消息未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

L5.0

我已经安装了DebugBar,它正在运行并显示在屏幕底部.但是我很难弄清楚如何将消息发送到控制台以显示在消息"下

I have the DebugBar installed, and it's working and showing at the bottom of the screen. But I'm having trouble figuring out how to send messages to the console to show up under "Messages"

我已经在控制器中尝试了以下方法...

I've tried the following in my controllers...

use DebugBar\DebugBar;
....
DebugBar::addMessage('This is a message');

甚至

use DebugBar\DebugBar;
....
DebugBar::info('this is info');

但是出现以下错误.

Call to undefined method DebugBar\DebugBar::info()

我的app.php具有以下内容.

my app.php has the following.

'providers' => [
.....
'Barryvdh\Debugbar\ServiceProvider',
....


'aliases' => [ 
....
'DebugBar'  => 'Barryvdh\Debugbar\Facade',

我仍然是Laravel新手,所以不确定下一步要去哪里检查.我已经在 http://phpdebugbar.com/docs/

I'm still a Laravel newbie, so not sure where to check next. I've checked the documentation on both http://phpdebugbar.com/docs/ and https://github.com/barryvdh/laravel-debugbar but I think I'm just missing something.

推荐答案

我认为问题是,您以错误的方式使用了provider-array.应该是:

I think the problem is, that you use the provider-array in a wrong way. It should be:

'providers' => [
    ...
    Barryvdh\Debugbar\ServiceProvider::class,
]

中的

.另外,请使用以下内容代替上面编写的字符串:

in your config/app.php. Also, please use the following instead of the string you wrote above:

'aliases' => [
    ...
    'DebugBar' => Barryvdh\Debugbar\Facade::class,
]

我在干净的Laravel-5安装上尝试了您的配置,但它不起作用.这可能是绝对类路径附带的.使用上面列出的配置,它可以很好地工作.

I tried your config on a clean Laravel-5 installation and it did not work. This is comes possibly with the absolute class paths. With the config listed above, it works very well.

这篇关于Laravel Debugbar消息未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆