Skip to content

Filament Event Sourcing

Bridge spatie/laravel-event-sourcing with Filament. Write through aggregates, browse stored events, and replay projectors, without hiding either side.

Why this package

Filament assumes Eloquent CRUD. Event sourcing routes writes through aggregates and reads through projections. This package bridges the two without hiding either side. You always write the aggregate call; the package provides the plumbing. It does not generate aggregates, events or projectors, and it does not map form state to domain commands.

Write bridge

Filament create, edit and delete pages persist through your aggregates while keeping the full page lifecycle: validation, mutate hooks, notifications and redirects.

Event history

Drop a read-only event history onto any record, either as a relation manager or a slide-over action, with version, timestamp and an expandable JSON payload per event.

Stored Events browser

A read-only resource over Spatie’s stored events with filters by event class, aggregate uuid and date range, and pretty-printed payloads.

Projector replay

A config-gated page to replay projectors one at a time, reporting how many events were replayed.

Primary-key agnostic

Works whether your projection uses a uuid primary key or an id primary key with a separate uuid column.

Small on purpose

No automatic form-to-command mapping, no queued projectors on managed resources. The package stays focused so your domain stays yours.

Requirements

  • PHP ^8.2
  • Laravel ^11.0 | ^12.0
  • Filament ^4.0
  • spatie/laravel-event-sourcing ^7.0

Next steps