Displaying ziggy packeg wrong

388 views Asked by At

I installed the package tightenco/ziggy, set it up as in the documentation, everything works. But the template displays the entire list of addresses as in the screenshot Please tell me where I went wrong

<head>
        @routes
        @vite('resources/js/app.js')
        @inertiaHead
    </head>
    <body>
        @inertia
    </body>

<Link :href="route('listing.show', listing.id)">
            <listingAddress :listing="listing" />
        </Link>

app.js
import { ZiggyVue } from 'ziggy'
import { Ziggy } from './ziggy';

vite.config

.use(ZiggyVue, Ziggy)

    resolve: {
    alias: {
        ziggy: path.resolve('/vendor/tightenco/ziggy/dist/vue.es.js')
    },
},

enter image description here

1

There are 1 answers

0
SeyT On BEST ANSWER

As stated on the documentation you can exclude certain routes or include the route you want to expose to the client .

Ziggy supports filtering the routes it makes available to your JavaScript, which is great if you have certain routes that you don't want to be included and visible in the source of the response sent back to clients. Filtering routes is optional—by default, Ziggy includes all your application's named routes.

To set up basic route filtering, create a config file in your Laravel app at config/ziggy.php and define either an only or except setting as an array of route name patterns.

// config/ziggy.php

return [
    'except' => ['_debugbar.*', '_ignition.*',],
];