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

Using DebugBar only in local environment #10

Closed
ludo237 opened this issue Oct 2, 2013 · 3 comments
Closed

Using DebugBar only in local environment #10

ludo237 opened this issue Oct 2, 2013 · 3 comments

Comments

@ludo237
Copy link

ludo237 commented Oct 2, 2013

I've a question and I can't figured it out.

I'm using, locally, your awesome debugbar and it works like a charm. But the problem comes when I publish, remotely, my project and the debugbar is still there.

Inside /boostrap/start.php I've

$env = $app->detectEnvironment(array(
    'local' => array('ludo.*','Ludo-MBPro.*'),
));

That allow me to use a /app/local/ folder for local configuration and it works fine for everythings. How can I enable debugbar to works only in local Env? Is there any kind of setup ? I can't spot it.

Edit: At the moment I've setup the ServiceProvider and the Alias inside the /app/local/app.php file. Is this the best way to handle it?

@barryvdh
Copy link
Owner

barryvdh commented Oct 2, 2013

I would set up the ServiceProvider and alias in app/config/app.php (not local).
The debugbar is by default set to only display when app.debug = true. I would suggest that your production environment doesn't have that set to true.
So if you set app/config/local/app.php with debug=false, it would work.

You can also publish the config and override the values (enable for local, disable otherwise), but you shouldn't have to.
Are you sure your environment get's picked up? You can simply echo App::environment() and see what Laravel detects.

@ludo237
Copy link
Author

ludo237 commented Oct 2, 2013

@barryvdh Cool thank you now it work, I forgot the debug variable 👍

@adrianogl
Copy link

in routes.php

if($env == 'local') {
Debugbar::enable();
} else {
Debugbar::disable();
}

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

3 participants