Skip to content

Instantly share code, notes, and snippets.

@leek
Last active March 23, 2016 02:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leek/9074c61385a968f72437 to your computer and use it in GitHub Desktop.
Save leek/9074c61385a968f72437 to your computer and use it in GitHub Desktop.
<?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,
]);
}
}
}
}
@leek
Copy link
Author

leek commented Mar 23, 2016

Note: This hack is no longer necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment