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
330
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
360
Event Sourcing In Laravel
freekmurze
0
200
Building a realtime dashboard with Laravel Livewire (PHPKonf)
freekmurze
0
670
A tour behind the scenes of Oh Dear (PHP Benelux)
freekmurze
2
690
A practical look at multitenancy in Laravel
freekmurze
1
280
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
610
Highlights Flare codebase (Laracon online)
freekmurze
0
340
Introducing Mailcoach
freekmurze
1
520
Highlights from the Flare codebase (Full Stack Ghent)
freekmurze
0
550
Other Decks in Programming
See All in Programming
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
130
Ruby Pattern Matching
bkuhlmann
0
930
Goのmultiple errorsについて (2024年4月版)
syumai
4
910
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
330
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
23
15k
Random\Randomizer クラスで日常のあれこれを解決しよう! / Random\Randomizer class solves familiar trouble
cocoeyes02
0
250
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
340
Zero Waste, Radical Magic, and Italian Graft – Quarkus Efficiency Secrets
hollycummins
0
230
Code Reviews
bkuhlmann
4
890
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
7
930
Elm Form Validation
bkuhlmann
0
510
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
2
760
Featured
See All Featured
KATA
mclloyd
15
12k
Building Adaptive Systems
keathley
31
1.9k
Producing Creativity
orderedlist
PRO
337
39k
No one is an island. Learnings from fostering a developers community.
thoeni
16
2.1k
Web development in the modern age
philhawksworth
202
10k
WebSockets: Embracing the real-time Web
robhawkes
59
7k
Being A Developer After 40
akosma
57
580k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
Designing for humans not robots
tammielis
248
25k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
Bash Introduction
62gerente
604
210k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
30
6k
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