phauthentic / event-store
Installs: 154
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/phauthentic/event-store
Requires
- php: ^8.2
Requires (Dev)
- ext-pdo: *
- infection/infection: ^0.29.6
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.5
- ramsey/uuid: ^4.7
- squizlabs/php_codesniffer: ^3.9
This package is auto-updated.
Last update: 2026-02-24 23:06:30 UTC
README
This is an event store abstraction for the Phauthentic Event Sourcing Library. It provides a simple interface for storing and retrieving domain events by aggregate, with pluggable backends for different storage engines.
Requirements
- PHP 8.2 or higher
Installation
composer require phauthentic/event-store
Features
- EventStoreInterface – Contract for storing and replaying events by aggregate
- PDO Event Store – SQL-backed store (MySQL, MariaDB, PostgreSQL, SQLite, MS SQL Server)
- In-Memory Event Store – For testing, prototyping, and demos
- EventFactory – Create events from arrays and convert events to arrays
- Serialization – Pluggable serializers for payload and metadata
Quick Start
use Phauthentic\EventStore\Event; use Phauthentic\EventStore\InMemoryEventStore; use Phauthentic\EventStore\ReplyFromPositionQuery; $eventStore = new InMemoryEventStore(); $event = new Event( aggregateId: 'order-123', aggregateVersion: 1, event: 'OrderCreated', payload: ['amount' => 99.99], createdAt: new \DateTimeImmutable() ); $eventStore->storeEvent($event); foreach ($eventStore->replyFromPosition(new ReplyFromPositionQuery('order-123', 1)) as $storedEvent) { // Process event... }
Documentation
Please start by reading documentation in this repository.
License
Copyright Florian Krämer
Licensed under the MIT license.