Skip to content

Commit

Permalink
Merge pull request #87 from juliancc/master
Browse files Browse the repository at this point in the history
fixes issue with config:cache issue #80
  • Loading branch information
pterk authored May 16, 2020
2 parents 37a2667 + 066fd64 commit 0379873
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
19 changes: 9 additions & 10 deletions src/GetStream/StreamLaravel/StreamLaravelServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ public function register()
}

$this->app->singleton('feed_manager', function ($app) {
$manager_class = $app['config']->get('stream-laravel::feed_manager_class');
$api_key = $app['config']->get('stream-laravel::api_key');
$api_secret = $app['config']->get('stream-laravel::api_secret');

$manager_class = config('stream-laravel.feed_manager_class');
$api_key = config('stream-laravel.api_key');
$api_secret = config('stream-laravel.api_secret');
return new $manager_class($api_key, $api_secret, $this->app['config']);
});
}
Expand All @@ -59,12 +58,12 @@ protected function registerResources()
if (file_exists($userConfigFile)) {
$userConfig = $this->app['files']->getRequire($userConfigFile);
$config = array_replace_recursive($config, $userConfig);
}

$namespace = 'stream-laravel::';

foreach($config as $key => $value) {
$this->app['config']->set($namespace . $key , $value);
} else {
//only set if we dont have a config file for stream-laravel
$namespace = 'stream-laravel.';
foreach($config as $key => $value) {
$this->app['config']->set($namespace . $key , $value);
}
}
}
}
12 changes: 6 additions & 6 deletions src/GetStream/StreamLaravel/StreamLumenServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ protected function registerResources()
if (file_exists($userConfigFile)) {
$userConfig = $this->app['files']->getRequire($userConfigFile);
$config = array_replace_recursive($config, $userConfig);
}

$namespace = 'stream-laravel::';

foreach($config as $key => $value) {
$this->app['config']->set($namespace . $key , $value);
} else {
//only set if we dont have a config file for stream-laravel
$namespace = 'stream-laravel.';
foreach($config as $key => $value) {
$this->app['config']->set($namespace . $key , $value);
}
}
}
}

1 comment on commit 0379873

@imam
Copy link

@imam imam commented on 0379873 Jun 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#88 Please review this issue, thank you

Please sign in to comment.