Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Tweak config booting
Browse files Browse the repository at this point in the history
  • Loading branch information
vinkla committed Jan 24, 2016
1 parent 87106f3 commit 3c7dab6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/InstagramServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,22 @@ class InstagramServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->setupConfig($this->app);
$this->setupConfig();
}

/**
* Setup the config.
*
* @param \Illuminate\Contracts\Container\Container $app
*
* @return void
*/
protected function setupConfig(Application $app)
protected function setupConfig()
{
$source = realpath(__DIR__.'/../config/instagram.php');

if ($app instanceof LaravelApplication && $app->runningInConsole()) {
if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {
$this->publishes([$source => config_path('instagram.php')]);
} elseif ($app instanceof LumenApplication) {
$app->configure('instagram');
} elseif ($this->app instanceof LumenApplication) {
$this->app->configure('instagram');
}

$this->mergeConfigFrom($source, 'instagram');
Expand Down

0 comments on commit 3c7dab6

Please sign in to comment.