Loading...
Loading...
How to work effectively with Laravel Wayfinder, always use when developing frontend features
npx skill4agent add markhamsquareventures/essentials wayfinderimport { show } from '@/actions/...'php artisan wayfinder:generate.form()--with-form<form {...store.form()}>action="/posts" method="post".get().post().patch().put().delete()show.head(1){ url: "/posts/1", method: "head" }import StorePost from '@/actions/.../StorePostController'; StorePost()@/routes/import { show } from '@/routes/post'; show(1)post.show{post:slug}show("my-post")show({ slug: "my-post" })mergeQuerywindow.location.searchnullshow(1, { mergeQuery: { page: 2, sort: null } }){ query: {...} }show(1, { query: { page: 1 } })"/posts/1?page=1"{ url, method }show(1){ url: "/posts/1", method: "get" }.url()show.url(1)"/posts/1"// 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" }<Form>