diff --git a/src/EventStore/ServiceProvider.php b/src/EventStore/ServiceProvider.php index bcc1de3..765a4c3 100644 --- a/src/EventStore/ServiceProvider.php +++ b/src/EventStore/ServiceProvider.php @@ -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; @@ -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'); }