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
I shall define this only once
Search
Freek Van der Herten
September 14, 2022
Programming
0
390
I shall define this only once
Freek Van der Herten
September 14, 2022
Tweet
Share
More Decks by Freek Van der Herten
See All by Freek Van der Herten
Uncharted packages (Laravel Live Denmark)
freekmurze
0
190
An Introduction to Snapshot testing
freekmurze
0
480
Event Sourcing In Laravel
freekmurze
0
240
Building a realtime dashboard with Laravel Livewire (PHPKonf)
freekmurze
0
790
A tour behind the scenes of Oh Dear (PHP Benelux)
freekmurze
2
840
A practical look at multitenancy in Laravel
freekmurze
1
340
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
720
Highlights Flare codebase (Laracon online)
freekmurze
0
490
Introducing Mailcoach
freekmurze
1
610
Other Decks in Programming
See All in Programming
Orleans + Sekiban + SignalR でリアルタイムWeb作ってみた
tomohisa
0
240
Optimizing JRuby 10
headius
0
580
Golangci-lint v2爆誕: 君たちはどうすべきか
logica0419
1
240
On-the-fly Suggestions of Rewriting Method Deprecations
ohbarye
3
5.1k
オープンソースコントリビュート入門
_katsuma
0
130
ComposeでのPicture in Picture
takathemax
0
130
ニーリーQAのこれまでとこれから
nealle
2
680
2025-04-25 GitHub Copilot Agent ライブデモ(スクリプト)
goataka
0
110
Improve my own Ruby
sisshiki1969
1
110
eBPF超入門「o11yに使える」とは (20250424_eBPF_o11y)
thousanda
1
110
カオスに立ち向かう小規模チームの装備の選択〜フルスタックTSという装備の強み _ 弱み〜/Choosing equipment for a small team facing chaos ~ Strengths and weaknesses of full-stack TS~
bitkey
1
140
Road to RubyKaigi: Making Tinny Chiptunes with Ruby
makicamel
4
540
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
For a Future-Friendly Web
brad_frost
177
9.7k
Faster Mobile Websites
deanohume
306
31k
Done Done
chrislema
184
16k
A better future with KSS
kneath
239
17k
Scaling GitHub
holman
459
140k
Site-Speed That Sticks
csswizardry
6
540
Being A Developer After 40
akosma
91
590k
Visualization
eitanlees
146
16k
Become a Pro
speakerdeck
PRO
28
5.3k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.8k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
19
1.2k
Transcript
I shall say define this only once
About me Freek Van der Herten Developer at SPATIE @freekmurze
freek.dev mailcoach.app ohdear.app fl areapp.io
Open source ± 300 packages on Packagist ± 360 000
000 downloads total ± 20 000 000 downloads a month
spatie.be/open-source
spatie.be/open-source/postcards
Let’s talk about Laravel Data
At Spatie Big projects Complex data, lots of properties and
relations A lot data structures de fi ned multiple times for di ff erent purposes Form requests, API resources, TypeScript de fi nitions
Laravel Data An easy to use Laravel package Create powerful
data objects A single de fi nition that can be used for multiple purposes Created by Ruben Van Assche 250K downloads
This talk A simple example Real world usage in Flare
Let’s code
In closing
Laravel Data Rich data objects De fi ne a data
structure only once Can replace API resources, Form Requests, … Generating TypeScript de fi nitions
Laravel Data Optional properties Lazy loading of properties Create data
from incoming requests, JSON and objects In fi nitely con fi gurable … and a whole lot more
spatie.be/docs/laravel-data
Laravel Data For everything For only small parts Don’t just
discard the Laravel defaults Do what is best for your team and project
One more thing
Laracon Promo 20% discount on all spatie products, no coupon
needed spatie.be/products Products: Ray, Mailcoach, Laravel Comments, MediaLibrary Pro Courses: Testing Laravel, Laravel Package Training, Laravel Beyond Crud, Writing Readable Laravel, Laravel Event Sourcing
Thank you! freek.dev mailcoach.app spatie.be ohdear.app fl areapp.io