Skip to content

Commit 0d49fca

Browse files
committed
Merge the default config using mergeConfigFrom
1 parent 4cda0d8 commit 0d49fca

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function registerArtisanCommands()
5050
*/
5151
protected function bindEvents($app)
5252
{
53-
$user_config = $app[static::$abstract . '.config'];
53+
$user_config = $app['config'][static::$abstract];
5454

5555
$handler = new SentryLaravelEventHandler($app[static::$abstract], $user_config);
5656

@@ -69,13 +69,10 @@ protected function bindEvents($app)
6969
*/
7070
public function register()
7171
{
72-
$this->app->singleton(static::$abstract . '.config', function ($app) {
73-
// Make sure we don't crash when we did not publish the config file and the config is null
74-
return $app['config'][static::$abstract] ?: array();
75-
});
72+
$this->mergeConfigFrom(__DIR__ . '/config.php', static::$abstract);
7673

7774
$this->app->singleton(static::$abstract, function ($app) {
78-
$user_config = $app[static::$abstract . '.config'];
75+
$user_config = $app['config'][static::$abstract];
7976
$base_path = base_path();
8077
$client = SentryLaravel::getClient(array_merge(array(
8178
'environment' => $app->environment(),
@@ -100,7 +97,7 @@ public function register()
10097

10198
return $client;
10299
});
103-
100+
104101
$app = $this->app;
105102

106103
// Add a sentry log channel for Laravel 5.6+

0 commit comments

Comments
 (0)