diff --git a/src/FcmServiceProvider.php b/src/FcmServiceProvider.php index 6525bd2..15dcc15 100644 --- a/src/FcmServiceProvider.php +++ b/src/FcmServiceProvider.php @@ -2,8 +2,10 @@ namespace Kawankoding\Fcm; +use Illuminate\Foundation\Application as LaravelApplication; use Illuminate\Support\ServiceProvider; use Kawankoding\Fcm\Fcm; +use Laravel\Lumen\Application as LumenApplication; /** * Class FcmServiceProvider @@ -13,9 +15,13 @@ class FcmServiceProvider extends ServiceProvider { public function boot() { - $this->publishes([ - __DIR__ . '/../resources/config/laravel-fcm.php' => config_path('laravel-fcm.php'), - ]); + if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) { + $this->publishes([ + __DIR__ . '/../resources/config/laravel-fcm.php' => config_path('laravel-fcm.php'), + ]); + } elseif ($this->app instanceof LumenApplication) { + $this->app->configure('laravel-fcm'); + } } public function register()