Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3 from madewithlove/develop
Browse files Browse the repository at this point in the history
binding eventbus and eveentdispatcher
  • Loading branch information
jdrieghe committed Apr 22, 2016
2 parents c9e603d + ce4af5f commit 5dab3ff
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/EventStore/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

namespace Madewithlove\LaravelCqrsEs\EventStore;

use Broadway\EventDispatcher\EventDispatcher;
use Broadway\EventDispatcher\EventDispatcherInterface;
use Broadway\EventHandling\EventBusInterface;
use Broadway\EventHandling\SimpleEventBus;
use Broadway\EventStore\EventStoreInterface;
use Broadway\EventStore\Management\EventStoreManagementInterface;
use Madewithlove\LaravelCqrsEs\EventStore\Console\Replay;
Expand All @@ -26,6 +30,13 @@ public function register()
return (new EventStoreManager($this->app))->driver();
});

$this->app->singleton(EventDispatcherInterface::class, function () {
return new EventDispatcher();
});
$this->app->singleton(EventBusInterface::class, function () {
return new SimpleEventBus();
});

$this->app->alias(EventStoreInterface::class, 'event_store.driver');
$this->app->alias(EventStoreManagementInterface::class, 'event_store.driver');
}
Expand Down

0 comments on commit 5dab3ff

Please sign in to comment.