diff --git a/config/app.php b/config/app.php index f3519fd1..ddca6146 100644 --- a/config/app.php +++ b/config/app.php @@ -247,7 +247,8 @@ return [ * Package Service Providers... */ Devfactory\Minify\MinifyServiceProvider::class, - Barryvdh\Debugbar\ServiceProvider::class, + // Debugbar is enabled only if APP_ENV=local + //Barryvdh\Debugbar\ServiceProvider::class, /* * Application Service Providers... diff --git a/overrides/Nwidart/Modules/Module.php b/overrides/Nwidart/Modules/Module.php index 645c1647..e8ba4ee8 100644 --- a/overrides/Nwidart/Modules/Module.php +++ b/overrides/Nwidart/Modules/Module.php @@ -175,7 +175,14 @@ abstract class Module extends ServiceProvider } if ($this->isLoadFilesOnBoot()) { - $this->registerFiles(); + try { + $this->registerFiles(); + } catch (\Exception $e) { + $e = \Eventy::filter('modules.register_error', $e, $this); + if ($e) { + throw $e; + } + } } $this->fireEvent('boot');