Replies: 1 comment 4 replies
-
Could you could |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Ziggy version
1.4.6
Laravel version
9.9.0
Description
Hi!
Not necessarily a bug but more of a question. Im using Laravel, Vue, InertiaJS and Ziggy together and trying the utilise the URL::defaults method laravel provides with Ziggy adheres to.
My problem is if I want to update these default values in the @routes directive, I of course have to refresh the page. The issue with that is IntertiaJS doesnt refresh and effective acts like an ajax call.
Is there anyone that has effectively updated the routes dynamically based on Inertia Share or hooks or something along those lines?
I have seen the way to pull in the routes by an API call, but this negates the fact i'm trying to use defaults to make my code leaner as I would have to include
Ziggy
with each use ofroute()
For context I have a set of nested routes as such:
spaces/{space}/pages/{page}/sections/{section}/blocks
spaces/{space}/pages/{page}/sections/{section}/blocks/create
spaces/{space}/pages/{page}/sections/{section}/blocks/{block}
spaces/{space}/pages/{page}/sections/{section}/blocks/{block}/edit
So I am trying to use URL defaults to set the
space id
,page id
,section id
whenever your within that nested part of the application, rather than having to include the parameters with eachroute()
call.Open to any suggestions or ideas!
Thanks for your work guys
Ziggy call and context
Ziggy configuration
Route definition
Beta Was this translation helpful? Give feedback.
All reactions