Hi
After adding 'Debugbar' => 'Barryvdh\Debugbar\Facade' to the aliases array in app.php
I then try to execute one of my controller actions containing the following:
public function getIndex(){
Debugbar::warning('Watch out..');
}
But I receive the following error:
Symfony \ Component \ Debug \ Exception \ FatalErrorException
Call to undefined method Barryvdh\Debugbar\Facade::warning()
Have I included the facade incorrectly?
Thanks a lot for you help.
Excerpt from 'aliases[]
'Validator' => 'Illuminate\Support\Facades\Validator',
'View' => 'Illuminate\Support\Facades\View',
'Twitter' => 'Thujohn\Twitter\TwitterFacade',
'Image' => 'Intervention\Image\Facades\Image',
'Debugbar' => 'Barryvdh\Debugbar\Facade' ),
Hmm, sorry, cannot really recreate this.
Does this work for you:
app('debugbar')->warning('Watch out..');
No I get:
Class debugbar does not exist
I'm using it in a controller, Do I need a use directive at the top of the controller right?
Are you in a namespace? If so, you can do \Debugbar::warning('Watch out..');
I am not, no.
And is the debugbar showing? It seems like the ServiceProvider isn't really working, which is strange.
What version of Laravel are you on?
@jonwhittlestone instead of
use DebugBar\DebugBar;
do this
use Debugbar;
That will work
I was getting the same issue. Adding use Debugbar; like godfreymakori mentioned worked, but it is strange because normally it should be use Debugbar\Debugbar;
Are you in a namespace? If so, you can do \Debugbar::warning('Watch out..');
This works
Most helpful comment
Are you in a namespace? If so, you can do \Debugbar::warning('Watch out..');