Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Projecting events in Laravel (Laravel Live)
Search
Freek Van der Herten
March 03, 2019
Programming
3
570
Projecting events in Laravel (Laravel Live)
Freek Van der Herten
March 03, 2019
Tweet
Share
More Decks by Freek Van der Herten
See All by Freek Van der Herten
Uncharted packages (ode aan de code)
freekmurze
0
31
Uncharted packages (Laravel Live Denmark)
freekmurze
0
230
I shall define this only once
freekmurze
0
440
An Introduction to Snapshot testing
freekmurze
0
510
Event Sourcing In Laravel
freekmurze
0
260
Building a realtime dashboard with Laravel Livewire (PHPKonf)
freekmurze
0
830
A tour behind the scenes of Oh Dear (PHP Benelux)
freekmurze
2
880
A practical look at multitenancy in Laravel
freekmurze
1
370
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
750
Other Decks in Programming
See All in Programming
Web エンジニアが JavaScript で AI Agent を作る / JSConf JP 2025 sponsor session
izumin5210
4
1.8k
乱雑なコードの整理から学ぶ設計の初歩
masuda220
PRO
32
14k
Flutterアプリ運用の現場で役立った監視Tips 5選
ostk0069
1
480
CloudflareのSandbox SDKを試してみた
syumai
0
170
自動テストのアーキテクチャとその理由ー大規模ゲーム開発の場合ー
segadevtech
2
1k
AIの弱点、やっぱりプログラミングは人間が(も)勉強しよう / YAPC AI and Programming
kishida
9
5.1k
知られているようで知られていない JavaScriptの仕様 4選
syumai
0
620
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
2
2.8k
Amazon Bedrock Knowledge Bases Hands-on
konny0311
0
150
The Missing Link in Angular's Signal Story: Resource API and httpResource
manfredsteyer
PRO
0
130
[堅牢.py #1] テストを書かない研究者に送る、最初にテストを書く実験コード入門 / Let's start your ML project by writing tests
shunk031
9
4.4k
Chart.jsで長い項目を表示するときのハマりどころ
yumechi
0
120
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
330
Building a Scalable Design System with Sketch
lauravandoore
463
33k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
118
20k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.3k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Raft: Consensus for Rubyists
vanstee
140
7.2k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Docker and Python
trallard
46
3.7k
Done Done
chrislema
186
16k
Designing for humans not robots
tammielis
254
26k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Transcript
Projecting events in Laravel
About me Freek Van der Herten Partner & developer at
Spatie @freekmurze https://murze.be https://ohdear.app
Spatie Since 2003 Websites, applications and webshops Team 9 awesome
human beings Specialisation Laravel, front-end development
Open Source Software
We create a lot of it ± 200 packages on
Packagist ± 2,000,000 downloads a month ± 25,000,000 total downloads All Postcardware!
Highlights Popular laravel-backup laravel-medialibrary laravel-permission New laravel-query-builder laravel-blade-x
https://spatie.be/open-source
https://spatie.be/open-source/postcards
Let's talk about projecting events
Talk overview Theory Laravel Event Projector demo
Theory
Traditional application Write data in database An update means overwriting
the old data The old data cannot be accessed anymore
APPLICATION DATABASE TABLE value X
APPLICATION DATABASE TABLE value X value Y
Using projectors The application will fire off events Events will
get written in a dedicated store Events are passed to classes that can handle them
APP EVENTS Event Event 1
APP EVENTS Event Event 1 Event 2
APP EVENTS Event Event 1 Event 2 Event 3
APP CONSUMER EVENTS PROJECTION Event Event 1 Event 2 Event
3
APP CONSUMER CONSUMER 2 EVENTS PROJECTION Event Event 1 Event
2 Event 3 ANOTHER PROJECTION
APP CONSUMER CONSUMER 2 EVENTS PROJECTION Event Event 1 Event
2 Event 3 ANOTHER PROJECTION
APP CONSUMER CONSUMER 2 EVENTS PROJECTION Event Event 1 Event
2 Event 3 Event 4 ANOTHER PROJECTION
Projecting events Auditing requirements Extra reports needed There is some
setup required
Laravel Event Projector
Laravel Event Projector It's not full event sourcing, it focuses
on projections Beautifully integrated into Laravel Easy to get started with
https://docs.spatie.be/laravel-event-projector
Demo
In closing
Summary Easy to use package to get started with projections
Hooks into Laravel's native events Replay capabilities Writes are harder, reads are easier
Resources https://kickstarter.engineering/event-sourcing-made-simple-4a2625113224 https://dev.to/barryosull/event-sourcing-what-it-is-and-why-its-awesome https://www.youtube.com/watch?v=28jmTeN3VYc https://github.com/eventsauce
Thank you! https://speakerdeck.com/freekmurze/projecting-events-in-laravel https://spatie.be/open-source https://murze.be https://ohdear.app https://fullstackeurope.com