Skip to content

Commit 9b32992

Browse files
Only extend notification channel if it exists (L5.2 support), fixes #182
1 parent 132bc6a commit 9b32992

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/DoctrineServiceProvider.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,13 @@ protected function bootExtensionManager()
259259
*/
260260
public function extendNotificationChannel()
261261
{
262-
$channel = $this->app['config']->get('doctrine.notifications.channel', 'database');
262+
if ($this->app->bound(ChannelManager::class)) {
263+
$channel = $this->app['config']->get('doctrine.notifications.channel', 'database');
263264

264-
$this->app->make(ChannelManager::class)->extend($channel, function ($app) {
265-
return new DoctrineChannel($app['registry']);
266-
});
265+
$this->app->make(ChannelManager::class)->extend($channel, function ($app) {
266+
return new DoctrineChannel($app['registry']);
267+
});
268+
}
267269
}
268270

269271
/**

0 commit comments

Comments
 (0)