You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In Laravel they have an api.php for API routes so there's no conflict with inertia routes.
In my routes file I set up a router.group with api prefix but that's just for url/entrypoint so conflicts/duplicates still occur.
Obviously, I can just name routes differently, or do router.resource('foo', [controller]).as(api.foo) but is there a better way?
Can I have a separate routes file for the API routes, so any request url with 'api' at start goes to those routes?
What do you guys recommend is the best way to structure routes for an inertia + API set of routes?
Beta Was this translation helpful? Give feedback.
All reactions