Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Debugbar messages not showing

Tags:

php

laravel-5

L5.0

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');

or even

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

but I'm getting the following error.

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

my app.php has the following.

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


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

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.

like image 613
dangel Avatar asked Sep 10 '25 22:09

dangel


1 Answers

if you want to show DebugBar this this process :

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

then

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

then in your controller write

app('debugbar')->error('Watch out..');

now refresh browser then see the message enjoy

like image 156
tapos ghosh Avatar answered Sep 12 '25 13:09

tapos ghosh