Best practice to render inertia answers for a component request from two different routes
Hello:
After coding with Inertia for a while (stack: VUE + Laravel) the moment has arrived when I have to use a component in two different pages in different routes.
So I have a component that retrieves information from /getConversationByID in the backend but that component is used in two different routes:
Main/Index.vue
Admin/index.vue
Which is the best practice to handle the return endPoint the Inertia::render has to use?
This is how I return the answers right now:
@jjmaster Why are you POST-ing to get a conversation? If you’re getting things then you should use the GET method. And if you’re getting something by ID, then the convention is to just specify the ID as part of the URI:
GET /conversations/{id}
No need to POST. And no need to have weird getFooById URIs.