Skip to content

Commit 765c0c5

Browse files
committed
L5 Config fallback
Load the default config for now..
1 parent d2e7e26 commit 765c0c5

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/ServiceProvider.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class ServiceProvider extends \Illuminate\Support\ServiceProvider
1717
public function boot()
1818
{
1919
$app = $this->app;
20-
$app['config']->package('barryvdh/laravel-debugbar', __DIR__ . '/config');
20+
21+
$this->registerConfiguration();
2122

2223
if ($app->runningInConsole()) {
2324
if ($this->app['config']->get('laravel-debugbar::config.capture_console') && method_exists($app, 'shutdown')) {
@@ -123,6 +124,21 @@ function ($app) {
123124
$this->app->middleware('Barryvdh\Debugbar\Middleware\Stack', array($this->app));
124125
}
125126
}
127+
128+
/**
129+
* Register configuration files, with L5 fallback
130+
*/
131+
protected function registerConfiguration()
132+
{
133+
// Is it possible to register the config?
134+
if (method_exists($this->app['config'], 'package')) {
135+
$this->app['config']->package('barryvdh/laravel-debugbar', __DIR__ . '/config');
136+
} else {
137+
// Load the config for now..
138+
$config = $this->app['files']->getRequire(__DIR__ .'/config/config.php');
139+
$this->app['config']->set('laravel-debugbar::config', $config);
140+
}
141+
}
126142

127143
/**
128144
* Get the services provided by the provider.

0 commit comments

Comments
 (0)