In a thread on X, Joe Tannenbaum and new beta of Laravel Wayfinder is now out.
Laravel Wayfinder bridges your Laravel backend and TypeScript frontend with zero friction. It automatically generates fully-typed TypeScript from your Laravel code. Stop manually maintaining route URLs, request types, and API contracts — Wayfinder keeps your frontend and backend perfectly in sync.
According to his post this version transforms so much more into TypeScript, straight from your PHP:
- 📍 Routes
- ⌨️ Form Requests
- 🗃️ Eloquent Models
- 🔢 PHP Enums
- 📃 Inertia Page Props
- 🌎 Inertia Shared Data
- 📡 Broadcast Channels
- 📣 Broadcast Events
- ⚙️ Vite Environment Variables
And it also includes some new friends:
- 🔍 Surveyor - A (mostly) static analysis tool designed to extract detailed information from your code
- 🧭 Ranger - A layer on top of Surveyor where you can register callbacks as entities are discovered and receive rich DTOs back
Key Highlights from the Wayfinder Beta
Here are some of the standout improvements:
- Wayfinder now parses the props you are passing to your Inertia pages and generates TypeScript types that stay in sync between your PHP and your component.
- Wayfinder parses any validation applied to a route and generates TypeScript types, which works seamlessly with Inertia's useForm hook
- Enums? We got you. Wayfinder generates TypeScript representations of your PHP enums automatically.
- The Laravel Echo hooks have been updated with the ability to infer payload from the broadcast event name. Wayfinder generates these declaration merging files, you guessed it, automatically.
- Speaking of declaration merging file files, Inertia gets to have some fun too. Wayfinder generates these files for your shared props so that you get full type support when using the usePage hook.
Check out the full release on the "next" branch in GitHub