EventSauce.

A pragmatic event sourcing library for PHP with a focus on developer experience.

Docs Newsletter GitHub Twitter

Why use EventSauce?

Model your domain using event sourcing; a message-driven approach that provides clarity when dealing with complex business requirements. The library is designed so you can take full control.

Events

Expressive Testing

Scenario based testing provides an expressive way to ensure business requirements are met.

<?php

use EventSauce\EventSourcing\AggregateRootTestCase;

class MyEventSourcedTest extends AggregateRootTestCase
{
    public function test_event_sourcing()
    {
        $this->given(
            new DeveloperLikesEventSourcing(),
            new DeveloperLearnedAboutEventSauce(),
        )->when(
            new StartsUsingEventSauce(
                $this->aggregateRootId()
            )
        )->then(
            new UsingEventSauceWasVeryEffective(),
            new DeveloperAcquiredNewSkill(
                AcquiredSkill::eventSourcing()
            )
        );
    }
}

Code Generation

Generated event and command definitions can greatly speed up your workflow. The built-in code generation tools provide an easy way to create them quickly.

namespace: ModellingWith\EventSauce

commands:
  StartsUsingEventSauce:
    fields:
      id: developerId

events:
  UsingEventSauceWasVeryEffective:
    fields: []
  DeveloperAcquiredNewSkill:
    fields:
      acquiredSkill:
        type: AcquiredSkill
        example: EVENT_SOURCING

Newsletter

Frank de Jonge

EventSauce is a project by Frank de Jonge.

This website is built using Tailwind CSS, Zondicons, and Webpack.