Typed Routes
Tachi Kit never hard-codes URLs in React. Laravel Wayfinder generates typed TypeScript functions for every route and controller action, so a renamed route or a missing parameter is a compile error instead of a broken link.
Two ways to import
Section titled “Two ways to import”Named routes, from @/routes:
import { dashboard, login } from '@/routes';import users from '@/routes/users';
<Link href={dashboard()}>Dashboard</Link><Link href={users.edit(user.id)}>Edit</Link>router.post(users.bulkDelete().url, { ids });Controller actions, from @/actions:
import UserController from '@/actions/App/Http/Controllers/UserController';
router.patch(UserController.updateStatus.url(user.id), { is_active: false });Each helper returns { url, method }, which Inertia’s <Link> and router accept directly. Use .url (or .url(...)) when you only need the string.
Form variants
Section titled “Form variants”.form() returns the action and method props for Inertia’s <Form> component, including method spoofing for PUT, PATCH and DELETE:
<Form {...ProfileController.update.form()}> {({ errors, processing }) => (/* … */)}</Form>The kit’s auth and settings pages rely on these form variants.
Regenerating
Section titled “Regenerating”The helpers are generated into resources/js/routes/ and resources/js/actions/. Both are gitignored, so they’re rebuilt on every machine:
- Automatically by the Wayfinder Vite plugin (
wayfinder({ formVariants: true })invite.config.ts) whenever Vite starts or builds, and whenever a file inroutes/orapp/Http/changes. - By hand:
php artisan wayfinder:generate --with-formCustomizing
Section titled “Customizing”Nothing to configure for normal use: add a route or controller method, and its helper appears. If you rename a route or remove an action, run npm run types:check to find every call site that needs updating.