Wayfinder + Svelte: typed Laravel routes without hardcoded URLs
Short answer: Wayfinder generates typed route helpers from Laravel controllers; aviwebsquad.in’s Svelte pages import @/actions and @/routes instead of string URLs—refactors rename in one Artisan command.
Setup recap
php artisan wayfinder:generate
Vite plugin regenerates on build. Laravel Boost skills enforce using Wayfinder in frontend tasks.
Before (fragile)
router.post('/contact', data);
After (tracked)
import { store } from '@/actions/App/Http/Controllers/ContactController';
store.form(data);
Rename controller method → TypeScript fails compile instead of shipping a 404.
Inertia Form component
<Form {...store.form()}> binds action + method with CSRF handled—matches Fortify patterns on auth pages.
Where I still use route() names
Blade crawlable partials are PHP—route('blog.posts.show') stays server-side per crawlable HTML.
FAQ
Tree shaking?
Import only used actions—Wayfinder supports it.
Ziggy vs Wayfinder?
Wayfinder is codegen-first; fits Vite + TS strict mode here.
OpenAPI for MCP?
Different surface—MCP uses Sanctum JSON, not Wayfinder.
Maintenance note (Sep 2026)
Re-validated internal links and examples against the live aviwebsquad.in CMS after the Hostinger migration; guidance in this article still matches production.