diff --git a/src/OneSignalServiceProvider.php b/src/OneSignalServiceProvider.php index 54f1f62..b1698c1 100644 --- a/src/OneSignalServiceProvider.php +++ b/src/OneSignalServiceProvider.php @@ -14,8 +14,14 @@ class OneSignalServiceProvider extends ServiceProvider public function boot() { $configPath = __DIR__ . '/../config/onesignal.php'; - $this->publishes([$configPath => config_path('onesignal.php')]); - $this->mergeConfigFrom($configPath, 'onesignal'); + $app = $this->app; + + if (class_exists('Illuminate\Foundation\Application') && $app instanceof LaravelApplication && $app->runningInConsole()) { + $this->publishes([$configPath => config_path('onesignal.php')]); + $this->mergeConfigFrom($configPath, 'onesignal'); + } else if ( class_exists('Laravel\Lumen\Application', false) ) { + $app->configure('onesignal'); + } } /**