Skip to content

Native Laravel Wayfinder support #8

Closed

Description

@n4ff4h

<Form action={store()}> accepts Wayfinder route/action objects (url + method), with method spoofing for PUT/PATCH/DELETE, and route params from the bound model.

Activity

  1. added
    next-genNext-gen Javaabu packages
    featurePackage feature from the spec
    on Nov 4, 2026
  2. added a commit that references this issue on Nov 4, 2026
    19cd33f
  3. n4ff4h commented on Nov 4, 2026

    @n4ff4h
    CollaboratorAuthor

    Done on next-gen (19cd33f).

    <Form action> takes:

    • a URL
    • a route object (store() → { url, method })
    • Wayfinder's form variant (update.form(user) → { action: "/users/1?_method=PUT", method: "post" }). The _method query parameter moves into the hidden field and the other query parameters stay.
    • a route function (update), called with the form's model

    The route's method applies unless method is set. PUT, PATCH and DELETE are spoofed. Tests are in src/core/router.test.tsx, docs in docs/advanced-usage/wayfinder.md.

    Decision: there's no Wayfinder package dependency, not even an optional peer. Wayfinder's runtime is generated into the app (resources/js/wayfinder), and @laravel/vite-plugin-wayfinder is a build tool that we never import. The types are structural (RouteDefinition, RouteFormDefinition), so any Wayfinder version that returns { url, method } works. Inertia, by contrast, is an optional peer (#7), because @javaabu/forms/inertia imports it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurePackage feature from the specnext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions