SPATIE

Services
Our philosophy Packages Postcards Guidelines Documentation
Products Blog About
Login Work with us

Docs Laravel-event-sourcing Advanced-usage Using your own event storage repository

Other versions for crawler v7 v6 v5 v4 v3 v2 v1
    • Introduction
    • Support us
    • Requirements
    • Installation & setup
    • Questions and issues
    • Changelog
    • Upgrading
    • Resources and alternatives
    • About us

    Getting familiar with event sourcing

    • Introduction
    • The traditional application
    • Using projectors to transform events
    • Using aggregates to make decisions based on the past

    Using projectors

    • Writing your first projector
    • Creating and registering projectors
    • Making sure events get handled in the right order
    • Thinking in events

    Using reactors

    • Writing your first reactor
    • Creating and configuring reactors

    Using aggregates

    • Writing your first aggregate
    • Creating and configuring aggregates
    • Testing aggregates
    • Snapshots

    Advanced usage

    • Preparing events
    • Replaying events
    • Storing metadata
    • Handling exceptions
    • Discovering projectors and reactors
    • Using your own event storage model
    • Using your own event storage repository
    • Using your own event serializer
    • Using aliases for stored event classes
    • Adding and Removing Projectors and Reactors
    • Aggregate Partials
    • Event Queries
    • Commands

Using your own event storage repository

The default repository responsible for storing events is \Spatie\EventSourcing\StoredEvents\Repositories\EloquentStoredEventRepository. If you want to use a different storage method, implement the \Spatie\EventSourcing\StoredEvents\Repositories\StoredEventRepository repository and add your custom functionality.

Using your own event storage model
Using your own event serializer
Help us improve this page
Event Sourcing in Laravel

Check out our course Event Sourcing

Help us improve this page
  • Services
  • Open source
  • Products
  • Courses
AboutBlogNewsletterDocsGuidelines

Kruikstraat 22, Box 12
2018 Antwerp, Belgium
info@spatie.be
+32 3 292 56 79
  • GitHub
  • Instagram
  • LinkedIn
  • X
  • Bluesky
  • Mastodon
  • YouTube
  • Privacy
  • Disclaimer

+32 3 292 56 79

Click to call us

A good
match?

What we do best

  • All things Laravel
  • Custom frontend components
  • Building APIs
  • AI-powered features
  • Simplifying things
  • Clean solutions
  • Integrating services

Not our cup of tea

  • WordPress themes
  • Cutting corners
  • Free mockups to win a job
  • "Just execute the briefing"

In short: we'd like to be a substantial part of your project.

Get in touch via email

    Enter a search term to find results in the documentation.