Skip to content

Commit

Permalink
Disable specific vendors (barryvdh#339)
Browse files Browse the repository at this point in the history
* to read configure file and affect renderer

* add disableVendors setting

* add braces to foreach syntax

* fulfillment comment rule

* fix typo
  • Loading branch information
dha0stw authored and barryvdh committed Dec 24, 2017
1 parent cb93a99 commit a3858e5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions config/debugbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@

'include_vendors' => true,

/*
|--------------------------------------------------------------------------
| Disable Vendors
|--------------------------------------------------------------------------
|
| Could be easily disable specific vendor by setting following array.
| You should inject jquery library manually.
| Options: 'jquery', 'highlightjs', 'fontawesome'.
|
*/

'disableVendors' => [],

/*
|--------------------------------------------------------------------------
| Capture Ajax Requests
Expand Down
6 changes: 6 additions & 0 deletions src/LaravelDebugbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,12 @@ function ($query, $bindings = null, $time = null, $connectionName = null) use ($
}

$renderer = $this->getJavascriptRenderer();
$disableVendors = $this->app['config']->get('debugbar.disableVendors', []);
if (!empty($disableVendors)) {
foreach($disableVendors as $vendor) {
$renderer->disableVendor($vendor);
{
}
$renderer->setIncludeVendors($this->app['config']->get('debugbar.include_vendors', true));
$renderer->setBindAjaxHandlerToXHR($app['config']->get('debugbar.capture_ajax', true));

Expand Down

0 comments on commit a3858e5

Please sign in to comment.