diff --git a/.ai/wayfinder/core.blade.php b/.ai/wayfinder/core.blade.php
new file mode 100644
index 00000000..da8c4292
--- /dev/null
+++ b/.ai/wayfinder/core.blade.php
@@ -0,0 +1,79 @@
+@php
+/** @var \Laravel\Boost\Install\GuidelineAssist $assist */
+@endphp
+## Laravel Wayfinder
+
+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 use `search-docs` to check wayfinder correct usage before implementing any features.
+- Always Prefer named imports for tree-shaking (e.g., `import { show } from '@/actions/...'`)
+- Avoid default controller imports (prevents tree-shaking)
+- Run `wayfinder:generate` after route changes if Vite plugin isn't installed
+
+### Feature Overview
+- Form Support: Use `.form()` with `--with-form` flag for HTML form attributes — `
+@endboostsnippet
+@endif
+@if($assist->roster->uses(\Laravel\Roster\Enums\Packages::INERTIA_VUE))
+@boostsnippet("Wayfinder Form Component (Vue)", "vue")
+
+@endboostsnippet
+@endif
+@if($assist->roster->uses(\Laravel\Roster\Enums\Packages::INERTIA_SVELTE))
+@boostsnippet("Wayfinder Form Component (Svelte)", "svelte")
+
+@endboostsnippet
+@endif
+@else
+If your application uses the `useForm` component from Inertia, you can directly submit to the wayfinder generated functions.
+
+
+ import { store } from "@/actions/App/Http/Controllers/ExampleController";
+
+ const form = useForm({
+ name: "My Big Post",
+ });
+
+ form.submit(store());
+
+@endif
+@endif
diff --git a/all.php b/all.php
index 1d5f4043..0469f1a9 100644
--- a/all.php
+++ b/all.php
@@ -54,6 +54,7 @@ public function packages(): \Laravel\Roster\PackageCollection
'folio' => \Laravel\Roster\Enums\Packages::FOLIO,
'pennant' => \Laravel\Roster\Enums\Packages::PENNANT,
'tailwindcss' => \Laravel\Roster\Enums\Packages::TAILWINDCSS,
+ 'wayfinder' => \Laravel\Roster\Enums\Packages::WAYFINDER,
];
if (isset($enumMapping[$packageName])) {
diff --git a/tests/Feature/Install/GuidelineComposerTest.php b/tests/Feature/Install/GuidelineComposerTest.php
index 44639c27..84e1e95e 100644
--- a/tests/Feature/Install/GuidelineComposerTest.php
+++ b/tests/Feature/Install/GuidelineComposerTest.php
@@ -23,7 +23,6 @@
$this->herd = Mockery::mock(Herd::class);
$this->herd->shouldReceive('isInstalled')->andReturn(false)->byDefault();
- // Bind the mock to the service container so it's used everywhere
$this->app->instance(Roster::class, $this->roster);
$this->composer = new GuidelineComposer($this->roster, $this->herd);
@@ -37,7 +36,6 @@
]);
$this->roster->shouldReceive('packages')->andReturn($packages);
- // Mock all Inertia package version checks
$this->roster->shouldReceive('usesVersion')
->with(Packages::INERTIA_LARAVEL, '2.1.0', '>=')
->andReturn($shouldIncludeForm);
@@ -426,3 +424,161 @@
->toContain('Run `npm install` to install dependencies')
->toContain('Package manager: npm');
});
+
+test('includes wayfinder guidelines with inertia integration when both packages are present', function (): void {
+ $packages = new PackageCollection([
+ new Package(Packages::LARAVEL, 'laravel/framework', '11.0.0'),
+ new Package(Packages::WAYFINDER, 'laravel/wayfinder', '1.0.0'),
+ new Package(Packages::INERTIA_REACT, 'inertiajs/inertia-react', '2.1.2'),
+ new Package(Packages::INERTIA_LARAVEL, 'inertiajs/inertia-laravel', '2.1.2'),
+ ]);
+
+ $this->roster->shouldReceive('packages')->andReturn($packages);
+
+ $this->roster->shouldReceive('uses')->with(Packages::INERTIA_LARAVEL)->andReturn(true);
+ $this->roster->shouldReceive('uses')->with(Packages::INERTIA_REACT)->andReturn(true);
+ $this->roster->shouldReceive('uses')->with(Packages::INERTIA_VUE)->andReturn(false);
+ $this->roster->shouldReceive('uses')->with(Packages::INERTIA_SVELTE)->andReturn(false);
+
+ $this->roster->shouldReceive('usesVersion')
+ ->with(Packages::INERTIA_LARAVEL, Mockery::any(), '>=')
+ ->andReturn(true);
+ $this->roster->shouldReceive('usesVersion')
+ ->with(Packages::INERTIA_REACT, Mockery::any(), '>=')
+ ->andReturn(true);
+ $this->roster->shouldReceive('usesVersion')
+ ->with(Packages::INERTIA_VUE, Mockery::any(), '>=')
+ ->andReturn(false);
+ $this->roster->shouldReceive('usesVersion')
+ ->with(Packages::INERTIA_SVELTE, Mockery::any(), '>=')
+ ->andReturn(false);
+
+ $guidelines = $this->composer->compose();
+
+ expect($guidelines)
+ ->toContain('=== wayfinder/core rules ===')
+ ->toContain('Wayfinder + Inertia')
+ ->toContain('Wayfinder Form Component (React)')
+ ->toContain('