Last active
March 23, 2016 02:28
-
-
Save leek/9074c61385a968f72437 to your computer and use it in GitHub Desktop.
Hack/workaround for this issue: https://github.com/barryvdh/laravel-debugbar/issues/405#issuecomment-166698699
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
class ConfigServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Overwrite any vendor / package configuration. | |
* This service provider is intended to provide a convenient location for you | |
* to overwrite any "vendor" or package configuration that you may want to | |
* modify before the application handles the incoming request / command. | |
*/ | |
public function register() | |
{ | |
if (! $this->app->environment('production')) { | |
$this->registerLocal(); | |
} | |
} | |
/** | |
* Overwritten items only on local environment. | |
*/ | |
protected function registerLocal() | |
{ | |
if (env('APP_DEBUG') && env('APP_DEBUG_BAR', true)) { | |
config(['debugbar.enabled' => true]); | |
// Disable if using BrowserSync | |
if (strpos(request()->root(), ':') !== false) { | |
config([ | |
'debugbar.collectors.default_request' => false, | |
'debugbar.collectors.symfony_request' => false, | |
]); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: This hack is no longer necessary.