Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I cant find a way to navigate to a new page when inertia-link is clicked when using a dynamic route in laravel.

route:

 This two is not added together in the code. I tried both way to tested so i put both here
 Route::get('/{clothesCategory}', 'ClothesController@getCalsas'); // this doesnt work
 Route::get('/NotDynamic, 'ClothesController@getCalsas'); // this work

Html:

<inertia-link href="/NotDynamic">Not Working</inertia-link> //this only works with NotDynamic route
<a href="/NotDynamic">Working</a> // this works with both routes

Why is this happening I dont understand the reason behind it? also how can I get the inertia-link to work with the Dynamic route?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
625 views
Welcome To Ask or Share your Answers For Others

1 Answer

Found how to do this using :headers

 <inertia-link href="/endpoint" :headers="{ clothesCategory: endpoint}">end point</inertia-link>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...