Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ jobs:
- name: Generate Application Key
run: php artisan key:generate

- name: Publish Ziggy Configuration
run: php artisan ziggy:generate

- name: Build Assets
run: npm run build

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
/public/storage
/storage/*.key
/storage/pail
/resources/js/actions
/resources/js/routes
/resources/js/wayfinder
/vendor
.env
.env.backup
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
resources/js/components/ui/*
resources/js/ziggy.js
resources/views/mail/*
5 changes: 0 additions & 5 deletions app/Http/Middleware/HandleInertiaRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Foundation\Inspiring;
use Illuminate\Http\Request;
use Inertia\Middleware;
use Tighten\Ziggy\Ziggy;

class HandleInertiaRequests extends Middleware
{
Expand Down Expand Up @@ -46,10 +45,6 @@ public function share(Request $request): array
'auth' => [
'user' => $request->user(),
],
'ziggy' => [
...(new Ziggy)->toArray(),
'location' => $request->url(),
],
'sidebarOpen' => ! $request->hasCookie('sidebar_state') || $request->cookie('sidebar_state') === 'true',
];
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"inertiajs/inertia-laravel": "^2.0",
"laravel/framework": "^12.0",
"laravel/tinker": "^2.10.1",
"tightenco/ziggy": "^2.4"
"laravel/wayfinder": "^0.1.9"
},
"require-dev": {
"fakerphp/faker": "^1.23",
Expand Down
38 changes: 8 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"devDependencies": {
"@eslint/js": "^9.19.0",
"@laravel/vite-plugin-wayfinder": "^0.1.3",
"@tailwindcss/vite": "^4.1.11",
"@types/node": "^22.13.5",
"@vitejs/plugin-vue": "^6.0.0",
Expand Down Expand Up @@ -38,8 +39,7 @@
"tailwind-merge": "^3.2.0",
"tailwindcss": "^4.1.1",
"tw-animate-css": "^1.2.5",
"vue": "^3.5.13",
"ziggy-js": "^2.4.2"
"vue": "^3.5.13"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "4.9.5",
Expand Down
2 changes: 0 additions & 2 deletions resources/js/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { createInertiaApp } from '@inertiajs/vue3';
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
import type { DefineComponent } from 'vue';
import { createApp, h } from 'vue';
import { ZiggyVue } from 'ziggy-js';
import { initializeTheme } from './composables/useAppearance';

const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
Expand All @@ -15,7 +14,6 @@ createInertiaApp({
setup({ el, App, props, plugin }) {
createApp({ render: () => h(App, props) })
.use(plugin)
.use(ZiggyVue)
.mount(el);
},
progress: {
Expand Down
5 changes: 3 additions & 2 deletions resources/js/components/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from '@/co
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
import UserMenuContent from '@/components/UserMenuContent.vue';
import { getInitials } from '@/composables/useInitials';
import { dashboard } from '@/routes';
import type { BreadcrumbItem, NavItem } from '@/types';
import { Link, usePage } from '@inertiajs/vue3';
import { BookOpen, Folder, LayoutGrid, Menu, Search } from 'lucide-vue-next';
Expand All @@ -35,7 +36,7 @@ const activeItemStyles = computed(
const mainNavItems: NavItem[] = [
{
title: 'Dashboard',
href: '/dashboard',
href: dashboard().url,
icon: LayoutGrid,
},
];
Expand Down Expand Up @@ -102,7 +103,7 @@ const rightNavItems: NavItem[] = [
</Sheet>
</div>

<Link :href="route('dashboard')" class="flex items-center gap-x-2">
<Link :href="dashboard()" class="flex items-center gap-x-2">
<AppLogo />
</Link>

Expand Down
5 changes: 3 additions & 2 deletions resources/js/components/AppSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import NavFooter from '@/components/NavFooter.vue';
import NavMain from '@/components/NavMain.vue';
import NavUser from '@/components/NavUser.vue';
import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem } from '@/components/ui/sidebar';
import { dashboard } from '@/routes';
import { type NavItem } from '@/types';
import { Link } from '@inertiajs/vue3';
import { BookOpen, Folder, LayoutGrid } from 'lucide-vue-next';
Expand All @@ -11,7 +12,7 @@ import AppLogo from './AppLogo.vue';
const mainNavItems: NavItem[] = [
{
title: 'Dashboard',
href: '/dashboard',
href: dashboard().url,
icon: LayoutGrid,
},
];
Expand All @@ -36,7 +37,7 @@ const footerNavItems: NavItem[] = [
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton size="lg" as-child>
<Link :href="route('dashboard')">
<Link :href="dashboard()">
<AppLogo />
</Link>
</SidebarMenuButton>
Expand Down
6 changes: 3 additions & 3 deletions resources/js/components/DeleteUser.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { destroy } from '@/actions/App/Http/Controllers/Settings/ProfileController';
import { Form } from '@inertiajs/vue3';
import { ref } from 'vue';

Expand All @@ -25,7 +26,7 @@ const passwordInput = ref<HTMLInputElement | null>(null);
<template>
<div class="space-y-6">
<HeadingSmall title="Delete account" description="Delete your account and all of its resources" />
<div class="p-4 space-y-4 border border-red-100 rounded-lg bg-red-50 dark:border-red-200/10 dark:bg-red-700/10">
<div class="space-y-4 rounded-lg border border-red-100 bg-red-50 p-4 dark:border-red-200/10 dark:bg-red-700/10">
<div class="relative space-y-0.5 text-red-600 dark:text-red-100">
<p class="font-medium">Warning</p>
<p class="text-sm">Please proceed with caution, this cannot be undone.</p>
Expand All @@ -36,8 +37,7 @@ const passwordInput = ref<HTMLInputElement | null>(null);
</DialogTrigger>
<DialogContent>
<Form
method="delete"
:action="route('profile.destroy')"
v-bind="destroy.form()"
reset-on-success
@error="() => passwordInput?.focus()"
:options="{
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/TextLink.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup lang="ts">
import { Method } from '@inertiajs/core';
import { LinkComponentBaseProps, Method } from '@inertiajs/core';
import { Link } from '@inertiajs/vue3';

interface Props {
href: string;
href: LinkComponentBaseProps['href'];
tabindex?: number;
method?: Method;
as?: string;
Expand Down
6 changes: 4 additions & 2 deletions resources/js/components/UserMenuContent.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<script setup lang="ts">
import UserInfo from '@/components/UserInfo.vue';
import { DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator } from '@/components/ui/dropdown-menu';
import { logout } from '@/routes';
import { edit } from '@/routes/profile';
import type { User } from '@/types';
import { Link, router } from '@inertiajs/vue3';
import { LogOut, Settings } from 'lucide-vue-next';
Expand All @@ -25,15 +27,15 @@ defineProps<Props>();
<DropdownMenuSeparator />
<DropdownMenuGroup>
<DropdownMenuItem :as-child="true">
<Link class="block w-full" :href="route('profile.edit')" prefetch as="button">
<Link class="block w-full" :href="edit()" prefetch as="button">
<Settings class="mr-2 h-4 w-4" />
Settings
</Link>
</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator />
<DropdownMenuItem :as-child="true">
<Link class="block w-full" method="post" :href="route('logout')" @click="handleLogout" as="button">
<Link class="block w-full" :href="logout()" @click="handleLogout" as="button">
<LogOut class="mr-2 h-4 w-4" />
Log out
</Link>
Expand Down
3 changes: 2 additions & 1 deletion resources/js/layouts/auth/AuthCardLayout.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import AppLogoIcon from '@/components/AppLogoIcon.vue';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { home } from '@/routes';
import { Link } from '@inertiajs/vue3';

defineProps<{
Expand All @@ -12,7 +13,7 @@ defineProps<{
<template>
<div class="flex min-h-svh flex-col items-center justify-center gap-6 bg-muted p-6 md:p-10">
<div class="flex w-full max-w-md flex-col gap-6">
<Link :href="route('home')" class="flex items-center gap-2 self-center font-medium">
<Link :href="home()" class="flex items-center gap-2 self-center font-medium">
<div class="flex h-9 w-9 items-center justify-center">
<AppLogoIcon class="size-9 fill-current text-black dark:text-white" />
</div>
Expand Down
3 changes: 2 additions & 1 deletion resources/js/layouts/auth/AuthSimpleLayout.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
import AppLogoIcon from '@/components/AppLogoIcon.vue';
import { home } from '@/routes';
import { Link } from '@inertiajs/vue3';

defineProps<{
Expand All @@ -13,7 +14,7 @@ defineProps<{
<div class="w-full max-w-sm">
<div class="flex flex-col gap-8">
<div class="flex flex-col items-center gap-4">
<Link :href="route('home')" class="flex flex-col items-center gap-2 font-medium">
<Link :href="home()" class="flex flex-col items-center gap-2 font-medium">
<div class="mb-1 flex h-9 w-9 items-center justify-center rounded-md">
<AppLogoIcon class="size-9 fill-current text-[var(--foreground)] dark:text-white" />
</div>
Expand Down
3 changes: 2 additions & 1 deletion resources/js/layouts/auth/AuthSplitLayout.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
import AppLogoIcon from '@/components/AppLogoIcon.vue';
import { home } from '@/routes';
import { Link, usePage } from '@inertiajs/vue3';

const page = usePage();
Expand All @@ -16,7 +17,7 @@ defineProps<{
<div class="relative grid h-dvh flex-col items-center justify-center px-8 sm:px-0 lg:max-w-none lg:grid-cols-2 lg:px-0">
<div class="relative hidden h-full flex-col bg-muted p-10 text-white lg:flex dark:border-r">
<div class="absolute inset-0 bg-zinc-900" />
<Link :href="route('home')" class="relative z-20 flex items-center text-lg font-medium">
<Link :href="home()" class="relative z-20 flex items-center text-lg font-medium">
<AppLogoIcon class="mr-2 size-8 fill-current text-white" />
{{ name }}
</Link>
Expand Down
15 changes: 8 additions & 7 deletions resources/js/layouts/settings/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,28 @@
import Heading from '@/components/Heading.vue';
import { Button } from '@/components/ui/button';
import { Separator } from '@/components/ui/separator';
import { appearance } from '@/routes';
import { edit as editPassword } from '@/routes/password';
import { edit } from '@/routes/profile';
import { type NavItem } from '@/types';
import { Link, usePage } from '@inertiajs/vue3';
import { Link } from '@inertiajs/vue3';

const sidebarNavItems: NavItem[] = [
{
title: 'Profile',
href: '/settings/profile',
href: edit().url,
},
{
title: 'Password',
href: '/settings/password',
href: editPassword().url,
},
{
title: 'Appearance',
href: '/settings/appearance',
href: appearance().url,
},
];

const page = usePage();

const currentPath = page.props.ziggy?.location ? new URL(page.props.ziggy.location).pathname : '';
const currentPath = typeof window !== undefined ? window.location.pathname : '';
</script>

<template>
Expand Down
5 changes: 3 additions & 2 deletions resources/js/pages/Dashboard.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<script setup lang="ts">
import AppLayout from '@/layouts/AppLayout.vue';
import { dashboard } from '@/routes';
import { type BreadcrumbItem } from '@/types';
import { Head } from '@inertiajs/vue3';
import PlaceholderPattern from '../components/PlaceholderPattern.vue';

const breadcrumbs: BreadcrumbItem[] = [
{
title: 'Dashboard',
href: '/dashboard',
href: dashboard().url,
},
];
</script>
Expand All @@ -16,7 +17,7 @@ const breadcrumbs: BreadcrumbItem[] = [
<Head title="Dashboard" />

<AppLayout :breadcrumbs="breadcrumbs">
<div class="flex h-full flex-1 flex-col gap-4 rounded-xl p-4 overflow-x-auto">
<div class="flex h-full flex-1 flex-col gap-4 overflow-x-auto rounded-xl p-4">
<div class="grid auto-rows-min gap-4 md:grid-cols-3">
<div class="relative aspect-video overflow-hidden rounded-xl border border-sidebar-border/70 dark:border-sidebar-border">
<PlaceholderPattern />
Expand Down
Loading