Skip to content

Commit

Permalink
verifying existence bugsnag in service file
Browse files Browse the repository at this point in the history
This change verifies if there’s an option for bugsnag in
`config/services.php` file. if so, it gets `$config` from there.

Therefore, it’s possible to retrieve API key from that file versus
creating a new `bugsnag.php` file
  • Loading branch information
ehkasper committed Apr 22, 2015
1 parent 8b9db79 commit a647ec9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ public function boot()
public function register()
{
$this->app->singleton('bugsnag', function ($app) {
$config = $app['config']['bugsnag'] ?: $app['config']['bugsnag::config'];
$config = isset($app['config']['services']['bugsnag']) ? $app['config']['services']['bugsnag'] : null;
if (is_null($config)) {
$config = $app['config']['bugsnag'] ?: $app['config']['bugsnag::config'];
}

$client = new \Bugsnag_Client($config['api_key']);
$client->setStripPath(base_path());
Expand Down

0 comments on commit a647ec9

Please sign in to comment.