Skip to content

Commit 9e5a0f9

Browse files
committed
replace ziggy with wayfinder
1 parent 8bb3219 commit 9e5a0f9

33 files changed

+116
-141
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ jobs:
4343
- name: Generate Application Key
4444
run: php artisan key:generate
4545

46-
- name: Publish Ziggy Configuration
47-
run: php artisan ziggy:generate
48-
4946
- name: Build Assets
5047
run: npm run build
5148

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
/public/storage
77
/storage/*.key
88
/storage/pail
9+
/resources/js/actions
10+
/resources/js/routes
11+
/resources/js/wayfinder
912
/vendor
1013
.env
1114
.env.backup

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
resources/js/components/ui/*
2-
resources/js/ziggy.js
32
resources/views/mail/*

app/Http/Middleware/HandleInertiaRequests.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Illuminate\Foundation\Inspiring;
66
use Illuminate\Http\Request;
77
use Inertia\Middleware;
8-
use Tighten\Ziggy\Ziggy;
98

109
class HandleInertiaRequests extends Middleware
1110
{
@@ -46,10 +45,6 @@ public function share(Request $request): array
4645
'auth' => [
4746
'user' => $request->user(),
4847
],
49-
'ziggy' => [
50-
...(new Ziggy)->toArray(),
51-
'location' => $request->url(),
52-
],
5348
'sidebarOpen' => ! $request->hasCookie('sidebar_state') || $request->cookie('sidebar_state') === 'true',
5449
];
5550
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"inertiajs/inertia-laravel": "^2.0",
1414
"laravel/framework": "^12.0",
1515
"laravel/tinker": "^2.10.1",
16-
"tightenco/ziggy": "^2.4"
16+
"laravel/wayfinder": "^0.1.9"
1717
},
1818
"require-dev": {
1919
"fakerphp/faker": "^1.23",

package-lock.json

Lines changed: 8 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"devDependencies": {
1313
"@eslint/js": "^9.19.0",
14+
"@laravel/vite-plugin-wayfinder": "^0.1.3",
1415
"@tailwindcss/vite": "^4.1.11",
1516
"@types/node": "^22.13.5",
1617
"@vitejs/plugin-vue": "^6.0.0",
@@ -38,8 +39,7 @@
3839
"tailwind-merge": "^3.2.0",
3940
"tailwindcss": "^4.1.1",
4041
"tw-animate-css": "^1.2.5",
41-
"vue": "^3.5.13",
42-
"ziggy-js": "^2.4.2"
42+
"vue": "^3.5.13"
4343
},
4444
"optionalDependencies": {
4545
"@rollup/rollup-linux-x64-gnu": "4.9.5",

resources/js/app.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { createInertiaApp } from '@inertiajs/vue3';
44
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
55
import type { DefineComponent } from 'vue';
66
import { createApp, h } from 'vue';
7-
import { ZiggyVue } from 'ziggy-js';
87
import { initializeTheme } from './composables/useAppearance';
98

109
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
@@ -15,7 +14,6 @@ createInertiaApp({
1514
setup({ el, App, props, plugin }) {
1615
createApp({ render: () => h(App, props) })
1716
.use(plugin)
18-
.use(ZiggyVue)
1917
.mount(el);
2018
},
2119
progress: {

resources/js/components/AppHeader.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from '@/co
1010
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
1111
import UserMenuContent from '@/components/UserMenuContent.vue';
1212
import { getInitials } from '@/composables/useInitials';
13+
import { dashboard } from '@/routes';
1314
import type { BreadcrumbItem, NavItem } from '@/types';
1415
import { Link, usePage } from '@inertiajs/vue3';
1516
import { BookOpen, Folder, LayoutGrid, Menu, Search } from 'lucide-vue-next';
@@ -35,7 +36,7 @@ const activeItemStyles = computed(
3536
const mainNavItems: NavItem[] = [
3637
{
3738
title: 'Dashboard',
38-
href: '/dashboard',
39+
href: dashboard().url,
3940
icon: LayoutGrid,
4041
},
4142
];
@@ -102,7 +103,7 @@ const rightNavItems: NavItem[] = [
102103
</Sheet>
103104
</div>
104105

105-
<Link :href="route('dashboard')" class="flex items-center gap-x-2">
106+
<Link :href="dashboard()" class="flex items-center gap-x-2">
106107
<AppLogo />
107108
</Link>
108109

resources/js/components/AppSidebar.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import NavFooter from '@/components/NavFooter.vue';
33
import NavMain from '@/components/NavMain.vue';
44
import NavUser from '@/components/NavUser.vue';
55
import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem } from '@/components/ui/sidebar';
6+
import { dashboard } from '@/routes';
67
import { type NavItem } from '@/types';
78
import { Link } from '@inertiajs/vue3';
89
import { BookOpen, Folder, LayoutGrid } from 'lucide-vue-next';
@@ -11,7 +12,7 @@ import AppLogo from './AppLogo.vue';
1112
const mainNavItems: NavItem[] = [
1213
{
1314
title: 'Dashboard',
14-
href: '/dashboard',
15+
href: dashboard().url,
1516
icon: LayoutGrid,
1617
},
1718
];
@@ -36,7 +37,7 @@ const footerNavItems: NavItem[] = [
3637
<SidebarMenu>
3738
<SidebarMenuItem>
3839
<SidebarMenuButton size="lg" as-child>
39-
<Link :href="route('dashboard')">
40+
<Link :href="dashboard()">
4041
<AppLogo />
4142
</Link>
4243
</SidebarMenuButton>

0 commit comments

Comments
 (0)