prooph/event-store-symfony-bundle
Symfony bundle integrating Prooph Event Store into Symfony apps. Provides configuration, services, and tooling to use Prooph’s event store with Symfony. Includes migration guidance, docs build instructions, and community support links.
prooph/event-store, maintaining alignment with Event Sourcing, CQRS, and DDD architectures. The update to Symfony matrix testing (v0.11.2) ensures compatibility with Symfony 6.4+ and PHP 8.2+, reinforcing its fit for modern PHP ecosystems.
Events system can still coexist, but prooph’s event store should remain the single source of truth to avoid duplication.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Symfony 6.4+ Dependency | Medium | Ensure Laravel stack (or Symfony bridge) supports Symfony 6.4+. Use symfony/ux or spatie/laravel-symfony for integration. |
| PHP 8.2+ Requirement | Medium | Upgrade Laravel to 10.x (or patch older versions with PHP 8.2 compatibility). |
| Testing Matrix Shift | Low | No functional changes; validates stability for newer Symfony versions. |
| Debugging Complexity | Medium | Leverage prooph/event-store-debugger alongside Laravel’s Pest/PHPUnit. |
| Vendor Lock-in | Low | prooph remains PSR-compliant; interfaces can be mocked for testing. |
prooph/event-store (non-Symfony).AppServiceProvider:
$this->app->bind(EventStore::class, fn() => new PdoEventStore(
new Connection($this->app['db']->connection('pgsql')->getPdo())
));
config/prooph.php:
'prooph_event_store' => [
'event_store' => [
'connection' => 'pgsql',
],
],
bus with prooph’s EventBus via a message handler adapter:
$this->app->bind(\Symfony\Component\Messenger\MessageBusInterface::class, fn() =>
new CommandBus($this->app->make(EventStore::class))
);
prooph/event-store directly (without the Bundle) and manually wire components.Order, User) with high write complexity.Order) with prooph’s AggregateRoot.php artisan prooph:migrate-events --from=legacy_table --to=event_store
| Component | Compatibility Notes |
|---|---|
| Laravel Events | Can coexist but should delegate to prooph to avoid inconsistency. |
| Laravel Queues | prooph’s EventBus can dispatch events to queues via Symfony Messenger. |
| Doctrine ORM | Avoid mixing Doctrine entities and event-sourced aggregates (separate concerns). |
| API Platform | prooph can power event-driven APIs (e.g., GraphQL subscriptions with Laravel Echo). |
| Testing | Use prooph/testing alongside Laravel’s Pest/PHPUnit for event assertions. |
composer require prooph/event-store-symfony-bundle prooph/event-store-pdo
config/packages/prooph_event_store.yaml (or config/prooph.php in Laravel).RecordedEvents:
class OrderAggregate extends AggregateRoot {
public function apply(OrderCreated $event) { ... }
}
EventStore in Laravel’s AppServiceProvider:
$this->app->bind(EventStore::class, fn() => new PdoEventStore(
new Connection($this->app['db']->connection()->getPdo())
));
CommandBus to handle domain commands (e.g., CreateOrderCommand).Event system to prooph (e.g., dispatch Laravel events → prooph events via a listener).EventStoreDebugger + Laravel’s Pest for assertions.Monolog:
$this->app['monolog']->pushHandler(new StreamHandler(storage_path('logs/prooph.log')));
How can I help you explore Laravel packages today?