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
340
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
An Introduction to Snapshot testing
freekmurze
0
390
Event Sourcing In Laravel
freekmurze
0
200
Building a realtime dashboard with Laravel Livewire (PHPKonf)
freekmurze
0
690
A tour behind the scenes of Oh Dear (PHP Benelux)
freekmurze
2
730
A practical look at multitenancy in Laravel
freekmurze
1
290
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
640
Highlights Flare codebase (Laracon online)
freekmurze
0
370
Introducing Mailcoach
freekmurze
1
550
Highlights from the Flare codebase (Full Stack Ghent)
freekmurze
0
590
Other Decks in Programming
See All in Programming
大規模マルチテナントを解決するYugabyteDBという選択肢
nnaka2992
1
250
Namespace on read
tagomoris
2
370
DynamoDB コスト最適化っぽいことの基本 with Terraform
kuro_kurorrr
2
250
はしめてのプログラミングとロボット制御
watawatavoltage
0
290
日付と正規化
megmogmog1965
0
140
GraphQL はいいぞ! ~Laravel で学ぶ GraphQL 入門~
azuki
1
160
TiDB Serverless ~理想のServerless DBを考える~
soso_15315
1
160
Play Billing Library 7.0.0 変更点まとめ@potatotips#88
kako351
0
160
【Go言語】golangci-lintの使い方
tomo1227
0
270
유연한 Composable 설계
l2hyunwoo
0
380
Findy - エンジニア向け会社紹介 / Findy Letter for Engineers
findyinc
2
81k
Trial
cairolibrary720
1
130
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
784
250k
What’s in a name? Adding method to the madness
productmarketing
PRO
21
2.9k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
189
16k
Thoughts on Productivity
jonyablonski
64
4.1k
Pencils Down: Stop Designing & Start Developing
hursman
118
11k
Designing the Hi-DPI Web
ddemaree
276
34k
Side Projects
sachag
451
42k
Debugging Ruby Performance
tmm1
71
11k
Automating Front-end Workflow
addyosmani
1362
200k
Building a Modern Day E-commerce SEO Strategy
aleyda
25
6.7k
RailsConf 2023
tenderlove
16
720
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
325
21k
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