Freek Van der Herten·
★ Keeping Laravel and TypeScript in sync with data objects
TL;DR
Keeping Laravel payloads and TypeScript types aligned by hand creates duplicate work and stale definitions. Spatie defines payloads as typed PHP data classes, generates TypeScript definitions from them, and automatically regenerates them when relevant PHP files change. This keeps frontend autocomplete current and lets the TypeScript compiler flag callers affected by backend changes.