Skip to content

Commit

Permalink
Update Debugbar to include autoshow setting (#1393)
Browse files Browse the repository at this point in the history
I think that's a valid point to include, due to the fact that in a lot of software with the autoshow set to true it's impossible to use the debugbar.
I'm in Laravel Nova right now, every time a notification ajax gets sent, the request I'm debugging gets removed by that setting.
I've tried to add a middleware to enable that setting, but it breaks other things in beetween.
Right now this it's the most polished solution.
Let me know if it's ok!
Thanks!
  • Loading branch information
G4Zz0L1 authored Feb 21, 2023
1 parent 8548ee3 commit aff3235
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/LaravelDebugbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -897,9 +897,12 @@ function (&$item) {
*/
public function injectDebugbar(Response $response)
{
$config = $this->app['config'];
$content = $response->getContent();

$renderer = $this->getJavascriptRenderer();
$autoShow = $config->get('debugbar.ajax_handler_auto_show', true);
$renderer->setAjaxHandlerAutoShow($autoShow);
if ($this->getStorage()) {
$openHandlerUrl = route('debugbar.openhandler');
$renderer->setOpenHandlerUrl($openHandlerUrl);
Expand Down

0 comments on commit aff3235

Please sign in to comment.