Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FatalErrorException: Call to undefined method Barryvdh\Debugbar\Facade::warning() #20

Closed
jonwhittlestone opened this issue Oct 16, 2013 · 11 comments

Comments

@jonwhittlestone
Copy link

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.

@jonwhittlestone
Copy link
Author

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

@barryvdh
Copy link
Owner

Hmm, sorry, cannot really recreate this.
Does this work for you:

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

@jonwhittlestone
Copy link
Author

No I get:

Class debugbar does not exist

@jonwhittlestone
Copy link
Author

I'm using it in a controller, Do I need a use directive at the top of the controller right?

@barryvdh
Copy link
Owner

Are you in a namespace? If so, you can do \Debugbar::warning('Watch out..');

@jonwhittlestone
Copy link
Author

I am not, no.

@barryvdh
Copy link
Owner

And is the debugbar showing? It seems like the ServiceProvider isn't really working, which is strange.
What version of Laravel are you on?

@godfreymakori
Copy link

@jonwhittlestone instead of

use DebugBar\DebugBar;

do this

use Debugbar;

That will work

@lawsonjt
Copy link

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;

@vihangarajalingam
Copy link

Are you in a namespace? If so, you can do \Debugbar::warning('Watch out..');

This works

@iwasherefirst2
Copy link

@jonwhittlestone instead of

use DebugBar\DebugBar;

do this

use Debugbar;

That will work

I had the same issue. When I use autoimport from PHPStorm I get use DebugBar\DebugBar;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants