Skip to content

Commit

Permalink
Add support for Lumen
Browse files Browse the repository at this point in the history
Changes to boot() provide support for Lumen, where original version breaks on install, since config_path() isn't available by default in Lumen
  • Loading branch information
jmrieger committed May 27, 2016
1 parent 93a2b33 commit 40be7b8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/OneSignalServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}

/**
Expand Down

0 comments on commit 40be7b8

Please sign in to comment.