Installation
Requirements
- PHP 8.4+
- the Sodium extension (
ext-sodium) - Composer
The package requires domainflow/uuid and Composer installs it automatically.
Install with Composer
composer require domainflow/event-sourcing-core
Start with the in-memory implementation
The package contains InMemoryEventStorage, InMemorySnapshotStorage, and
other in-memory implementations for tests and examples. They do not persist
data between PHP processes and are not a database adapter.
use DomainFlow\EventSourcing\Facade\EventSourcingFacade;
use DomainFlow\EventSourcing\Storage\InMemoryEventStorage;
$facade = new EventSourcingFacade(new InMemoryEventStorage());
For production persistence, provide an implementation of
EventStorageInterface and, when needed, the snapshot, outbox, and process
manager storage interfaces. See Storage contracts.