Laravel Wayfinder

VerifiedSafe

Generates typed TypeScript functions for Laravel routes and controllers, keeping backend and frontend in sync. Use it to import controller methods or named routes with support for parameters, HTTP methods, and query merging. Helps achieve type safety and tree-shaking in Laravel + Inertia or vanilla frontend apps.

Sby Skills Guide Bot
DevelopmentIntermediate
6/2/2026
Claude CodeCursorWindsurfCopilotCodex
#laravel#wayfinder#typescript#routing#frontend

Recommended for

Automated summary

Generates TypeScript functions and types for Laravel controllers and routes, ensuring synchronization between backend and frontend code.

Strengths

  • Strong typing between backend and frontend
  • Automatic route synchronization after generation
  • Support for HTTP methods, forms, and route parameters
  • Tree-shaking optimization via named imports

Limitations

  • Requires Laravel and the Wayfinder package installation
  • Must be regenerated after each route change
  • Does not cover all advanced Laravel routing cases
When to use it

When building frontend features for a Laravel application that needs typed and safe route management.

When not to use it

For non-Laravel projects or when the frontend does not require advanced route synchronization with the backend.

Security analysis

Safe
Quality score85/100

The skill contains only development guidance for using a Laravel code-generation package, with no executable commands, no data exfiltration, and no destructive actions. It is purely instructional for frontend development practices.

No concerns found

How this analysis is made

Examples

Generate Wayfinder types after adding a new route
I've added a new route in my Laravel `routes/web.php`. Please run the Wayfinder generation command and show me how to use the new route in a React component with type safety.
Use Wayfinder with Inertia forms
I need to create a form in my Laravel Inertia app using the Wayfinder package. Show me how to generate the form action and method automatically.

name: wayfinder description: How to work effectively with Laravel Wayfinder, always use when developing frontend features

Wayfinder

Instructions

Wayfinder generates TypeScript functions and types for Laravel controllers and routes which you can import into your client side code. It provides type safety and automatic synchronization between backend routes and frontend code.

Development Guidelines

  • Always Prefer named imports for tree-shaking (e.g., import { show } from '@/actions/...')
  • Avoid default controller imports (prevents tree-shaking)
  • Run php artisan wayfinder:generate after route changes if there are any errors

Feature Overview

  • Form Support: Use .form() with --with-form flag for HTML form attributes — <form {...store.form()}> → action="/posts" method="post"
  • HTTP Methods: Call .get(), .post(), .patch(), .put(), .delete() for specific methods — show.head(1) → { url: "/posts/1", method: "head" }
  • Invokable Controllers: Import and invoke directly as functions. For example, import StorePost from '@/actions/.../StorePostController'; StorePost()
  • Named Routes: Import from @/routes/ for non-controller routes. For example, import { show } from '@/routes/post'; show(1) for route name post.show
  • Parameter Binding: Detects route keys (e.g., {post:slug}) and accepts matching object properties — show("my-post") or show({ slug: "my-post" })
  • Query Merging: Use mergeQuery to merge with window.location.search, set values to null to remove — show(1, { mergeQuery: { page: 2, sort: null } })
  • Query Parameters: Pass { query: {...} } in options to append params — show(1, { query: { page: 1 } }) → "/posts/1?page=1"
  • Route Objects: Functions return { url, method } shaped objects — show(1) → { url: "/posts/1", method: "get" }
  • URL Extraction: Use .url() to get URL string — show.url(1) → "/posts/1"

Examples

<code-snippet name="Wayfinder Basic Usage" lang="typescript"> // Import controller methods (tree-shakable) import { show, store, update } from '@/actions/App/Http/Controllers/PostController'
// Get route object with URL and method...
show(1) // { url: "/posts/1", method: "get" }

// Get just the URL...
show.url(1) // "/posts/1"

// Use specific HTTP methods...
show.get(1) // { url: "/posts/1", method: "get" }
show.head(1) // { url: "/posts/1", method: "head" }

// Import named routes...
import { show as postShow } from '@/routes/post' // For route name 'post.show'
postShow(1) // { url: "/posts/1", method: "get" }
</code-snippet>

Wayfinder + Inertia

If your application uses the <Form> component from Inertia, you can use Wayfinder to generate form action and method automatically. <code-snippet name="Wayfinder Form Component (React)" lang="typescript">

<Form {...store.form()}><input name="title" /></Form> </code-snippet>

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/laravel-wayfinder-mm5t8bwg/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/laravel-wayfinder-mm5t8bwg' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/laravel-wayfinder-mm5t8bwg/download' --output '.skill-downloads/laravel-wayfinder-mm5t8bwg/SKILL.md.part' && mv '.skill-downloads/laravel-wayfinder-mm5t8bwg/SKILL.md.part' '.skill-downloads/laravel-wayfinder-mm5t8bwg/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/laravel-wayfinder-mm5t8bwg/SKILL.md' && test -s '.skill-downloads/laravel-wayfinder-mm5t8bwg/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/wayfinder' && cp -R '.skill-downloads/laravel-wayfinder-mm5t8bwg' '.claude/skills/wayfinder'

Cursor
test -f '.skill-downloads/laravel-wayfinder-mm5t8bwg/SKILL.md' && test -s '.skill-downloads/laravel-wayfinder-mm5t8bwg/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/wayfinder' && cp -R '.skill-downloads/laravel-wayfinder-mm5t8bwg' '.cursor/skills/wayfinder'

Codex
test -f '.skill-downloads/laravel-wayfinder-mm5t8bwg/SKILL.md' && test -s '.skill-downloads/laravel-wayfinder-mm5t8bwg/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/wayfinder' && cp -R '.skill-downloads/laravel-wayfinder-mm5t8bwg' '.agents/skills/wayfinder'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/laravel-wayfinder-mm5t8bwg'

openskills read 'laravel-wayfinder-mm5t8bwg'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/laravel-wayfinder-mm5t8bwg/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills