Headless CMS and Laravel routing
I am using a Headless CMS to manage the content of a new website I am working on. Everything works fine, I have just a small issue regarding routing.
I have some routes with controllers returning my data. I also fetch related articles. Let say I query the route /news it returns all my news. I click on an article I then query news/the-clicked-articled this article is displayed and I have a box that displays related articles, but as far as those can be anywhere on the website, I do not know what route to use in order not to have duplicated content. I would like to query the original route (for now I did a /related route with a show($slug)method, but I would like to have the original route.
I generate my menu with lavary/laravel-menu
I of course know in which cartegory is the related article (let say courses) would it be wise to get the $menu from laravel-menu and loop through it to find the corresponding route? How would you go about it?
Please or to participate in this conversation.