markhamsquareventures/essentials

wayfinder

How to work effectively with Laravel Wayfinder, always use when developing frontend features

First seen Jan 24, 2026

Installation

$ npx skills add markhamsquareventures/essentials --skill wayfinder

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from markhamsquareventures/essentials.

npx skills add markhamsquareventures/essentials

Browse all from markhamsquareventures/essentials

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Default branch main
Open issues 1
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,951 B
  • docs SUMMARY.md 109 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 46 installs

SKILL.md

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>