What is Wayfinder?
Laravel Wayfinder is a package that bridges a Laravel backend and a TypeScript frontend with zero friction. It auto-generates fully typed TypeScript functions from your controllers and routes, so you can call Laravel endpoints as functions directly from your frontend code. Hardcoded URLs, manually managed route parameters, and hand-syncing backend changes—all of that goes away.Wayfinder is in Beta (currently v0.1.x). The API may change before v1.0.0. All notable changes are recorded in the CHANGELOG.
Differences between Ziggy and Wayfinder
What is Ziggy?
Ziggy has long been a widely used route helper in the Laravel ecosystem. It exposes Laravel route definitions to JavaScript so you can generate URLs likeroute('posts.show', { id: 1 }).
Why replace it with Wayfinder?
Because Ziggy handles route names and parameters as strings, its TypeScript integration is limited. Typos in route names or wrong parameter names show up only as runtime errors. Wayfinder is TypeScript-first and generates controller methods as importable functions.
In Inertia-based Laravel starter kits (React, Vue, Svelte), Wayfinder is adopted as the standard.
Installation
1. Install the server-side package via Composer
2. Install the Vite plugin via NPM
3. Add the plugin to vite.config.js
Generating TypeScript definitions
Generate TypeScript files with thewayfinder:generate command.
resources/js.
--path option.
Basic usage
Importing and using an action
Here’s an example that produces the URL forPostController@show.
.url() when you only need the URL.
Passing parameters
Wayfinder functions accept parameters in several forms./posts/{post:slug}), pass that value.
Importing a whole controller
You can also import a whole controller and call its methods.Single-action controllers
For single-action (invokable) controllers, call the imported function directly.Importing named routes
Access by route name using files underroutes/.
Query parameters
Every Wayfinder function accepts aquery option to add query parameters.
mergeQuery to merge with the current URL’s query parameters.
Form variants
For use with traditional HTML forms, generate with--with-form and use the .form variant.
Combining Inertia and Wayfinder
Combining Inertia form helpers with Wayfinder lets you submit forms without writing any URL strings.Link component.
Adoption in starter kits
If you create a new project withlaravel new and choose React, Vue, or Svelte, you get a setup with Wayfinder configured. The starter kits include:
- The Composer package
laravel/wayfinder - The NPM package
@laravel/vite-plugin-wayfinder - Plugin configuration already applied in
vite.config.js - Generated directories already added to
.gitignore
Handling reserved words and conflicting method names
Controller methods with the same name as a JavaScript reserved word (likedelete or import) get a Method suffix.
Current status (v0.1.x)
The current stable version is provided on thev0.1.x branch. As of March 2026, the latest version is v0.1.15.
v0.1.x main changelog
Next-gen features under development on the next branch
The next branch is developing a substantially expanded next version.
Greatly expanded TypeScript generation
While v0.1.x targets only routes and controller actions, the next version generates all of the following as TypeScript.Form Request TypeScript type generation
Eloquent model type generation
types.d.ts.
PHP Enum → TypeScript conversion
Output directory changes
In v0.1.x, output was split into three directories (actions/, routes/, wayfinder/). In the next version everything lives under resources/js/wayfinder.
Main differences from v0.1.x to next
- Import paths changed from
@/actions/...to@/wayfinder/... - The
--skip-actions,--skip-routes, and--with-formflags are retired in favor of a configuration file types.tsis renamed totypes.d.ts
Summary
Laravel Wayfinder redesigns the “reference Laravel routes from JavaScript” feature Ziggy provided, in a TypeScript-first way. Its approach of importing generated functions delivers big improvements in type safety, IDE support, and tree shaking. Even the current v0.1.x enables type-safe references to routes and controller actions and is adopted by default in Inertia-based Laravel starter kits. The next-branch version under development plans to evolve into a more comprehensive type-safety foundation that also generates Form Requests, Eloquent models, enums, and Inertia page props as TypeScript.Laravel Wayfinder GitHub
Source code, CHANGELOG, and issues.
Vite Plugin Wayfinder
Detailed configuration options for the Vite plugin.