inertiajs / inertia-laravel

The Laravel adapter for Inertia.js.
https://inertiajs.com
MIT License
2.01k stars 224 forks source link

✨Feature Request: Support `ziggy` 2.0 #588

Closed xsjcTony closed 6 months ago

xsjcTony commented 6 months ago

This is what's happening after upgarded to ziggy 2.0 in both Laravel and frontend. Probably caused by the namespace change https://github.com/tighten/ziggy/blob/2.x/UPGRADING.md#upgrading-from-1x-to-2x image image

hamzaelmaghari commented 6 months ago

Hi @xsjcTony, I see no issue here ziggy is a dependent composer package, check your code and find any ziggy declarations then correct the namespace manualy;

EX: in routes files if you're using routes as API, controllers if you're passing props to components instead of setting global @routes, stc...

xsjcTony commented 6 months ago

I've searched through the whole project, seems all references to BladeRouteGenerator have the updated namespace. No idea why it is breaking, but if it's none of business here, yeah I'll close the issue. image

yaliv commented 5 months ago

I got the same error and I'm not sure if I did something wrong.

Just solved the issue by running php artisan optimize:clear (see this comment). AFAIK I don't use Laravel cache. It's my machine, not production :thinking:

xsjcTony commented 5 months ago

Yeah it's cache issue. I'm using Laravel + Vite with HMR, and as long as edit something in the app.blade.php with @route directive, it worked.