Please see Ziggy's docs on how to setup it with Vue:
May 29, 2022
8
Level 3
Laravel, Vue3, Inertia, Vite implement Ziggy
Im currently programming a applictation with the above mentioned stack and wanted to implement ziggy, but im lost.
I added ziggy via composer composer require tightenco/ziggy
Then added the @blade in the main blade file.
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,500;0,700;1,500&display=swap" rel="stylesheet">
@routes
<title>Laravel with Inertia</title>
@vite
</head>
<body class="antialiased bg-gray-900">
@inertia
</body>
</html>
But it still wont work like this
<Link :href="$route('users.create')">Create User</Link>
The Inertia docs mention something like
app.config.globalProperties.$route = route
But I dont know where to put it ?
Level 3
If anyone is interested in how I fixed the issue pleas have a look here https://github.com/tighten/ziggy/discussions/565
5 likes
Please or to participate in this conversation.