Skip to content

Used ruote Ziggy file globaly #769

Answered by bakerkretzmar
Skaywalker asked this question in Q&A
Discussion options

You must be logged in to vote

I don't completely understand your screenshots but you don't need two separate routers, just two Ziggy configs. It looks like you've figured that part out, but if not there's a --group option you can pass to the artisan command to create separate files with separate route groups. Then everything in your first two screenshots is unnecessary—if you're using the Vue plugin, just pass it your admin config when you install it on the admin pages:

// website
import { createApp } from 'vue';
import { ZiggyVue } from 'ziggy-js';
import { Ziggy } from './ziggy-website.js'; // import website routes
import App from './App.vue';

createApp(App).use(ZiggyVue, Ziggy);
// admin
import { createApp } from '…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Skaywalker
Comment options

Answer selected by Skaywalker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants