Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Projecting events in Laravel (Laravel Live)
Search
Freek Van der Herten
March 03, 2019
Programming
620
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Projecting events in Laravel (Laravel Live)
Freek Van der Herten
March 03, 2019
More Decks by Freek Van der Herten
See All by Freek Van der Herten
Uncharted packages (ode aan de code)
freekmurze
0
77
Uncharted packages (Laravel Live Denmark)
freekmurze
0
270
I shall define this only once
freekmurze
0
500
An Introduction to Snapshot testing
freekmurze
0
600
Event Sourcing In Laravel
freekmurze
0
290
Building a realtime dashboard with Laravel Livewire (PHPKonf)
freekmurze
0
900
A tour behind the scenes of Oh Dear (PHP Benelux)
freekmurze
2
940
A practical look at multitenancy in Laravel
freekmurze
1
410
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
810
Other Decks in Programming
See All in Programming
AWSに止められる覚悟してますか?
morizo_1984
2
510
Domain-Driven Transformation
hschwentner
2
2.3k
パーソナライズPodcastを作った話
repunit11
0
120
SREの越境 / SRE Collaboration
y0hgi
2
300
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
150
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.5k
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
1
2.2k
速習iPhone Duo対応
yuukiw00w
2
960
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
130
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
7
1.8k
Heart of Swift Concurrency
koher
0
1.2k
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
130
Featured
See All Featured
A better future with KSS
kneath
240
18k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
570
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
The Cult of Friendly URLs
andyhume
79
7k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
What's in a price? How to price your products and services
michaelherold
247
13k
Rails Girls Zürich Keynote
gr2m
96
14k
Chasing Engaging Ingredients in Design
codingconduct
0
340
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
We Are The Robots
honzajavorek
0
380
Building Applications with DynamoDB
mza
96
7.2k
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