Skip to content

Commit a3858e5

Browse files
dha0stwbarryvdh
authored andcommitted
Disable specific vendors (barryvdh#339)
* to read configure file and affect renderer * add disableVendors setting * add braces to foreach syntax * fulfillment comment rule * fix typo
1 parent cb93a99 commit a3858e5

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

config/debugbar.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,19 @@
5555

5656
'include_vendors' => true,
5757

58+
/*
59+
|--------------------------------------------------------------------------
60+
| Disable Vendors
61+
|--------------------------------------------------------------------------
62+
|
63+
| Could be easily disable specific vendor by setting following array.
64+
| You should inject jquery library manually.
65+
| Options: 'jquery', 'highlightjs', 'fontawesome'.
66+
|
67+
*/
68+
69+
'disableVendors' => [],
70+
5871
/*
5972
|--------------------------------------------------------------------------
6073
| Capture Ajax Requests

src/LaravelDebugbar.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,12 @@ function ($query, $bindings = null, $time = null, $connectionName = null) use ($
483483
}
484484

485485
$renderer = $this->getJavascriptRenderer();
486+
$disableVendors = $this->app['config']->get('debugbar.disableVendors', []);
487+
if (!empty($disableVendors)) {
488+
foreach($disableVendors as $vendor) {
489+
$renderer->disableVendor($vendor);
490+
{
491+
}
486492
$renderer->setIncludeVendors($this->app['config']->get('debugbar.include_vendors', true));
487493
$renderer->setBindAjaxHandlerToXHR($app['config']->get('debugbar.capture_ajax', true));
488494

0 commit comments

Comments
 (0)