Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Wayfinder Laravel Package

laravel/wayfinder

Generates fully typed, importable TypeScript functions from your Laravel routes and controllers. Call backend endpoints like normal TS functions—no hardcoded URLs or manual syncing. Includes an Artisan generator and Vite plugin for auto-regeneration.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Wayfinder
How does Laravel Wayfinder work with Laravel’s routing system?
Wayfinder scans your Laravel routes and controller actions, then generates TypeScript functions that mirror your backend endpoints. It respects named routes, model binding, and query parameters, so your frontend can call them like native imports. No manual URL string manipulation is needed—just import and use the generated functions.
Can I use Wayfinder with Laravel 10, 11, or 12?
Yes, Wayfinder officially supports Laravel 10+ and has been tested up to Laravel 13. The package leverages Laravel’s routing system, so as long as your app is on a supported version, Wayfinder will work seamlessly. Always check the [changelog](https://github.com/laravel/wayfinder/blob/main/CHANGELOG.md) for version-specific updates.
Do I need to modify my existing Laravel routes or controllers?
No changes are required to your backend. Wayfinder automatically detects your routes and controller actions, generating TypeScript definitions without altering your PHP code. It works with named routes, resource controllers, and even dynamic segments like `{user:slug}`.
How do I integrate Wayfinder with Vite for real-time updates?
Install the `@laravel/vite-plugin-wayfinder` via npm and add it to your `vite.config.js`. The plugin watches for changes to your Laravel routes/controllers and regenerates TypeScript definitions on the fly during development. This ensures your frontend stays in sync without manual rebuilds.
Will Wayfinder work with Inertia.js or other frontend frameworks?
Wayfinder is framework-agnostic and works with React, Vue, Svelte, or vanilla TypeScript. It’s especially powerful with Inertia.js, as you can use generated functions directly in your page components (e.g., `useForm.submit(wayfinderAction)`). The generated types ensure type safety across your entire stack.
Can I skip generating TypeScript for specific routes or actions?
Yes, use the `--skip-actions` or `--skip-routes` flags with the `wayfinder:generate` Artisan command. For example, `php artisan wayfinder:generate --skip-actions` will exclude controller actions from generation. This is useful for internal or non-public endpoints.
What happens if my Laravel routes change frequently?
Wayfinder is designed for dynamic environments. Run `php artisan wayfinder:generate` to regenerate TypeScript definitions, or rely on the Vite plugin for real-time updates during development. The generated files are auto-generated and can be `.gitignore`d, so you won’t need to manually sync changes.
Are there any performance concerns with Wayfinder in production?
Wayfinder generates TypeScript definitions at build time, so there’s no runtime overhead. However, if your app has thousands of routes, test the build time impact. The generated files are tree-shakable, and Wayfinder leverages Laravel’s route caching for efficiency. Monitor your CI/CD pipeline for large-scale apps.
How do I handle route parameters or model binding in TypeScript?
Wayfinder automatically infers types for route parameters and model binding. For example, if you have a route like `Route::get('/users/{user}', ...)`, the generated TypeScript function will include the `user` parameter with its correct type (e.g., `user: User`). This eliminates runtime errors and provides IDE autocompletion.
What’s the fallback if Wayfinder breaks or doesn’t support a feature?
Wayfinder is still in beta, so monitor the [changelog](https://github.com/laravel/wayfinder/blob/main/CHANGELOG.md) for updates. If needed, you can manually construct URLs or use a hybrid approach (e.g., mix Wayfinder-generated functions with Axios calls). The package is designed to be non-intrusive, so your existing backend remains functional.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai