Skip to content

Commit

Permalink
Add support for Lumen
Browse files Browse the repository at this point in the history
  • Loading branch information
andriyandriyan committed May 27, 2020
1 parent c4f703b commit 16744f5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/FcmServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit 16744f5

Please sign in to comment.