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
350
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
140
An Introduction to Snapshot testing
freekmurze
0
420
Event Sourcing In Laravel
freekmurze
0
210
Building a realtime dashboard with Laravel Livewire (PHPKonf)
freekmurze
0
720
A tour behind the scenes of Oh Dear (PHP Benelux)
freekmurze
2
760
A practical look at multitenancy in Laravel
freekmurze
1
300
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
660
Highlights Flare codebase (Laracon online)
freekmurze
0
410
Introducing Mailcoach
freekmurze
1
570
Other Decks in Programming
See All in Programming
文化が生産性を作る
jimpei
3
540
複数プロダクトの技術改善・クラウド移行に向き合うチームのフレキシブルなペア・モブプログラミングの実践 / Flexible Pair Programming And Mob Programming
honyanya
0
200
タイミーにおけるデータの利用シーンと データ基盤の挑戦
marufeuille
4
3.2k
선언형 UI를 학습할 때 알아둬야하는 키워드들
l2hyunwoo
0
130
Pydantic x Database API:turu-pyの開発
yassun7010
1
550
DjangoNinjaで高速なAPI開発を実現する
masaya00
0
500
個人開発で使ってるやつを紹介する回
yohfee
1
690
メルカリ ハロ アプリの技術スタック
atsumo
2
700
データサイエンスのフルサイクル開発を実現する機械学習パイプライン
xcnkx
2
500
ROS 2のZenoh対応とZenohのROS 2対応
takasehideki
2
290
C#および.NETに対する誤解をひも解く
ymd65536
0
250
"Swarming" をコンセプトに掲げるアジャイルチームのベストプラクティス
boykush
2
230
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
51
13k
Why You Should Never Use an ORM
jnunemaker
PRO
53
9k
What the flash - Photography Introduction
edds
67
11k
How GitHub Uses GitHub to Build GitHub
holman
473
290k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
3
220
Become a Pro
speakerdeck
PRO
24
4.9k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.6k
Facilitating Awesome Meetings
lara
49
6k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Into the Great Unknown - MozCon
thekraken
30
1.4k
A Philosophy of Restraint
colly
202
16k
Atom: Resistance is Futile
akmur
261
25k
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