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
360
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
170
An Introduction to Snapshot testing
freekmurze
0
440
Event Sourcing In Laravel
freekmurze
0
220
Building a realtime dashboard with Laravel Livewire (PHPKonf)
freekmurze
0
740
A tour behind the scenes of Oh Dear (PHP Benelux)
freekmurze
2
800
A practical look at multitenancy in Laravel
freekmurze
1
320
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
680
Highlights Flare codebase (Laracon online)
freekmurze
0
440
Introducing Mailcoach
freekmurze
1
590
Other Decks in Programming
See All in Programming
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
快速入門可觀測性
blueswen
0
360
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
250
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
760
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
330
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
330
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
250
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
330
42 best practices for Symfony, a decade later
tucksaun
1
180
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
5
820
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
220
モバイルアプリにおける自動テストの導入戦略
ostk0069
0
110
Featured
See All Featured
Thoughts on Productivity
jonyablonski
67
4.4k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Scaling GitHub
holman
458
140k
Designing for Performance
lara
604
68k
A designer walks into a library…
pauljervisheath
204
24k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Into the Great Unknown - MozCon
thekraken
33
1.5k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Docker and Python
trallard
42
3.1k
Documentation Writing (for coders)
carmenintech
66
4.5k
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