FIX: fix exception when debug bar was not installed

This commit is contained in:
Michal Kváček
2016-04-06 18:01:31 +02:00
parent 303a84904e
commit 543cce17fa
+6 -1
View File
@@ -55,8 +55,13 @@ class AppServiceProvider extends ServiceProvider
public function register() public function register()
{ {
if ($this->app->environment() == 'local') { if ($this->app->environment() == 'local') {
$this->app->register('Iber\Generator\ModelGeneratorProvider'); try {
$this->app->register('Barryvdh\Debugbar\ServiceProvider'); $this->app->register('Barryvdh\Debugbar\ServiceProvider');
} catch (\Exception $e) {
// this service provider may not exist when switching from other environment than local
// until composer install is run
// just ignore this exception and when no service provider is available, do not use debugbar
}
} }
// register PingPong module extension // register PingPong module extension