Activates whenever referencing backend routes in frontend components. Use when importing from @/actions or @/routes, calling Laravel routes from TypeScript, or working with Wayfinder route functions.
Use search-docs for detailed Wayfinder patterns and documentation.
Run after route changes if Vite plugin isn't installed:
php artisan wayfinder:generate --no-interaction
For form helpers, use --with-form flag:
php artisan wayfinder:generate --with-form --no-interaction
// Named imports for tree-shaking (preferred)...
import { show, store, update } from '@/actions/App/Http/Controllers/PostController'
// Named route imports...
import { show as postShow } from '@/routes/post'
<!-- Wayfinder Methods -->
<!-- Wayfinder Form (Svelte) -->
// Get route object...
show(1) // { url: "/posts/1", method: "get" }
// Get URL string...
show.url(1) // "/posts/1"
// Specific HTTP methods...
show.get(1)
store.post()
update.patch(1)
destroy.delete(1)
// Form attributes for HTML forms...
store.form() // { action: "/posts", method: "post" }
// Query parameters...
show(1, { query: { page: 1 } }) // "/posts/1?page=1"
Use Wayfinder with the <Form> component:
<Form {...store.form()}><input name="title" /></Form>
php artisan wayfinder:generate to regenerate routes if Vite plugin isn't installed