PHPackages                             spatie/laravel-event-sourcing - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. spatie/laravel-event-sourcing

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

spatie/laravel-event-sourcing
=============================

The easiest way to get started with event sourcing in Laravel

7.15.0(2mo ago)9003.7M—3.6%17520MITPHPPHP ^8.0CI failing

Since Sep 20Pushed 2mo ago12 watchersCompare

[ Source](https://github.com/spatie/laravel-event-sourcing)[ Packagist](https://packagist.org/packages/spatie/laravel-event-sourcing)[ Docs](https://github.com/spatie/laravel-event-sourcing)[ Fund](https://spatie.be/open-source/support-us)[ RSS](/packages/spatie-laravel-event-sourcing/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (22)Versions (128)Used By (20)

 [   ![Logo for laravel-event-sourcing](https://camo.githubusercontent.com/d7d024760a88304d524b6b2f502fd8507c7755cbfc7c9f4853e206ba17da93c8/68747470733a2f2f7370617469652e62652f7061636b616765732f6865616465722f6c61726176656c2d6576656e742d736f757263696e672f68746d6c2f6c696768742e77656270)  ](https://spatie.be/open-source?utm_source=github&utm_medium=banner&utm_campaign=laravel-event-sourcing)Event sourcing for Artisans 📽
=============================

[](#event-sourcing-for-artisans-)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8ae1f38e0658adb8b6668a1f4c5385a18e26f5b2803da3fdd63a150a0028199f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d6576656e742d736f757263696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-event-sourcing)[![Tests](https://github.com/spatie/laravel-event-sourcing/workflows/run-tests/badge.svg)](https://github.com/spatie/laravel-event-sourcing/workflows/run-tests/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/3327d1e20db42a7a5462e024b7eeeb24cbb72786cfdf5e10611dd1250134a1fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d6576656e742d736f757263696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-event-sourcing)

This package aims to be the entry point to get started with event sourcing in Laravel. It can help you with setting up aggregates, projectors, and reactors.

If you've never worked with event sourcing, or are uncertain about what aggregates, projectors and reactors are head over to the getting familiar with event sourcing section [in our docs](https://spatie.be/docs/laravel-event-sourcing/v7/introduction).

Event sourcing might be a good choice for your project if:

- your app needs to make decisions based on the past
- your app has auditing requirements: the reason why your app is in a certain state is equally as important as the state itself
- you foresee that there will be a reporting need in the future, but you don't know yet which data you need to collect for those reports

If you want to skip to reading code immediately, here are some example apps. In each of them, you can create accounts and deposit or withdraw money.

- [Larabank built traditionally without event sourcing](https://github.com/spatie/larabank-traditional)
- [Larabank built with projectors](https://github.com/spatie/larabank-event-projector)
- [Larabank built with aggregates and projectors](https://github.com/spatie/larabank-event-projector-aggregates)

Event sourcing in Laravel course
--------------------------------

[](#event-sourcing-in-laravel-course)

If you want to learn more about event sourcing, check out [our course on event sourcing in Laravel](https://event-sourcing-laravel.com)

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/81fa00b044e6e54055e86d5863d486c859a37f0e47d93695cb512b8e240311e3/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d6576656e742d736f757263696e672e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-event-sourcing)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Documentation
-------------

[](#documentation)

You can find installation instructions and detailed instructions on how to use this package at [the dedicated documentation site](https://spatie.be/docs/laravel-event-sourcing/v7/introduction/).

Upgrading from laravel-event-projector
--------------------------------------

[](#upgrading-from-laravel-event-projector)

This package supercedes [laravel-event-projector](https://github.com/spatie/laravel-event-projector). It has the same API. Upgrading from laravel-event-projector to laravel-event-sourcing is easy. Take a look at [our upgrade guide](UPGRADING.md).

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you've found a bug regarding security please mail  instead of using the issue tracker.

Postcardware
------------

[](#postcardware)

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.

We publish all received postcards [on our company website](https://spatie.be/en/opensource/postcards).

Credits
-------

[](#credits)

- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

The aggregate root functionality is heavily inspired by [Frank De Jonge](https://twitter.com/frankdejonge)'s excellent [EventSauce](https://eventsauce.io/) package. A big thank you to [Dries Vints](https://github.com/driesvints) for giving lots of valuable feedback while we were developing the package.

Footnotes
---------

[](#footnotes)

1 Quote taken from [Event Sourcing made Simple](https://kickstarter.engineering/event-sourcing-made-simple-4a2625113224)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

72

—

ExcellentBetter than 100% of packages

Maintenance83

Actively maintained with recent releases

Popularity68

Solid adoption and visibility

Community43

Growing community involvement

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 62.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Recently: every ~2 days

Total

122

Last Release

85d ago

Major Versions

5.0.8 → 6.0.02021-11-24

6.0.5 → 7.0.02022-01-20

v3.x-dev → v5.x-dev2022-01-31

v5.x-dev → 7.0.12022-03-03

6.0.6 → 7.3.12022-12-22

PHP version history (4 changes)0.0.1PHP ^7.3

2.0.0PHP ^7.4

4.7.0PHP ^8.0|^7.4

5.0.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (908 commits)")[![brendt](https://avatars.githubusercontent.com/u/6905297?v=4)](https://github.com/brendt "brendt (228 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (70 commits)")[![AyoobMH](https://avatars.githubusercontent.com/u/37803924?v=4)](https://github.com/AyoobMH "AyoobMH (31 commits)")[![morrislaptop](https://avatars.githubusercontent.com/u/67807?v=4)](https://github.com/morrislaptop "morrislaptop (23 commits)")[![WouterBrouwers](https://avatars.githubusercontent.com/u/40539118?v=4)](https://github.com/WouterBrouwers "WouterBrouwers (23 commits)")[![adrianspacely](https://avatars.githubusercontent.com/u/3690710?v=4)](https://github.com/adrianspacely "adrianspacely (17 commits)")[![juukie](https://avatars.githubusercontent.com/u/2678657?v=4)](https://github.com/juukie "juukie (15 commits)")[![erikgaal](https://avatars.githubusercontent.com/u/1234268?v=4)](https://github.com/erikgaal "erikgaal (13 commits)")[![inmanturbo](https://avatars.githubusercontent.com/u/47095624?v=4)](https://github.com/inmanturbo "inmanturbo (12 commits)")[![rodrigopedra](https://avatars.githubusercontent.com/u/5470108?v=4)](https://github.com/rodrigopedra "rodrigopedra (10 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (9 commits)")[![27pchrisl](https://avatars.githubusercontent.com/u/6286310?v=4)](https://github.com/27pchrisl "27pchrisl (8 commits)")[![dilab](https://avatars.githubusercontent.com/u/218813?v=4)](https://github.com/dilab "dilab (8 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (8 commits)")[![telkins](https://avatars.githubusercontent.com/u/53731?v=4)](https://github.com/telkins "telkins (8 commits)")[![inxilpro](https://avatars.githubusercontent.com/u/21592?v=4)](https://github.com/inxilpro "inxilpro (7 commits)")[![deanlj](https://avatars.githubusercontent.com/u/4245429?v=4)](https://github.com/deanlj "deanlj (6 commits)")[![colinc](https://avatars.githubusercontent.com/u/16424?v=4)](https://github.com/colinc "colinc (6 commits)")[![soarecostin](https://avatars.githubusercontent.com/u/6401790?v=4)](https://github.com/soarecostin "soarecostin (6 commits)")

---

Tags

aggregateeventlaravelphpprojectionsourcingeventspatieaggregatessourcingprojectorsreactorslaravel-event-sourcing

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/spatie-laravel-event-sourcing/health.svg)

```
[![Health](https://phpackages.com/badges/spatie-laravel-event-sourcing/health.svg)](https://phpackages.com/packages/spatie-laravel-event-sourcing)
```

###  Alternatives

[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M191](/packages/spatie-laravel-backup)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[spatie/laravel-health

Monitor the health of a Laravel application

86910.0M83](/packages/spatie-laravel-health)[spatie/laravel-enum

Laravel Enum support

3655.4M31](/packages/spatie-laravel-enum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
