diff --git a/src/GetStream/StreamLaravel/StreamLaravelServiceProvider.php b/src/GetStream/StreamLaravel/StreamLaravelServiceProvider.php index 2f1efd9..b54f94e 100644 --- a/src/GetStream/StreamLaravel/StreamLaravelServiceProvider.php +++ b/src/GetStream/StreamLaravel/StreamLaravelServiceProvider.php @@ -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']); }); } @@ -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); + } } } } diff --git a/src/GetStream/StreamLaravel/StreamLumenServiceProvider.php b/src/GetStream/StreamLaravel/StreamLumenServiceProvider.php index 107b50e..9f6b530 100644 --- a/src/GetStream/StreamLaravel/StreamLumenServiceProvider.php +++ b/src/GetStream/StreamLaravel/StreamLumenServiceProvider.php @@ -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); + } } } }