-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Enable laravel debugbar dynamically #1384
Comments
Having same issue here. I've tried custom Middleware and AppServiceProvider methods. No dice yet. |
Do you want to enable the debugbar only on certain routes? |
Any updates on this? |
You can enable debugbar only on certain routes by passing an array of URIs. https://github.com/barryvdh/laravel-debugbar/blob/master/config/debugbar.php#L13-L22 Also, maybe you can have a middleware similar to https://github.com/barryvdh/laravel-debugbar/blob/master/src/Middleware/InjectDebugbar.php |
I do the same, and works protected $middlewarePriority = [
///
\App\Http\Middleware\DebugbarEnabler::class, // my middleware
\Barryvdh\Debugbar\Middleware\InjectDebugbar::class,
]; |
Is there any way to disable the debugbar by default and enable it dynamically in the middleware?
When in AppServiceProvider boot I add Debugbar::disable(); and then in the middleware in the condition I add Debugbar::enable(); it does not work.
Replacing config('debugbar.enabled') doesn't work either.
Is it possible to do?
The text was updated successfully, but these errors were encountered: