Closed spam-n-eggs closed 2 years ago
Your Mix alias looks right to me, which means you can import ZiggyVue
from just ziggy
. The Ziggy
config object should be imported from your generated routes file, which you can generate with php artisan ziggy:generate
—or, if you're using the @routes
Blade directive, you can leave that out and omit the second argument to Vue.use()
since the routes will be available globally already.
The two arguments to Vue.use()
are the Vue plugin itself and then an optional configuration object that will be passed in to the plugin, so your setup should look something like this:
import { ZiggyVue } from 'ziggy';
import Ziggy from './ziggy.js';
Vue.use(ZiggyVue, Ziggy);
Ziggy version
v1.4.5
Laravel version
v8.83.6
Description
After set up, the Ziggy context is not available at all, nor is the route() helper.
Laravel Mix Alias is set up as follows:
From the app configuration js:
Ziggy call and context
Ziggy configuration
Route definition