Enjoying Laravel Data
summary
Spatie's Laravel-Data provides a single data-object definition that replaces duplicate attribute lists across form requests, API resources and front-end types, inferring validation from typed properties and supporting nested objects and lazy loading. A CLI typescript-transform generates matching TypeScript (demo shows ~106 types from a large domain, ~900 lines) and V4 previews add route scanning plus an action helper for fully typed route calls. Package is battle-tested (2M+ downloads), powers Flare and works with Inertia and Livewire v2, reducing repetitive boilerplate.
AI-written summary · about
chapters (9)
- 0:00Introduction and background
- 2:56Problem with data structures
- 4:24Introducing Laravel Data
- 8:40Simple demo with Contact Data
- 11:53Replacing form requests and API resources
- 15:50Real-world use case in Flare
- 20:50Preview of Laravel Data V4
- 24:04Closing and future plans
- 27:36Q&A session








