Replies: 1 comment 2 replies
-
Hey @bitkidd! 👋 You can already have nested resources. Route.resource('posts', 'PostsController').apiOnly()
Route.resource('posts.comments', 'CommentsController').apiOnly() 📚 https://docs.adonisjs.com/guides/controllers#nested-resources -- What would be the use-case to change |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey!
Recently was working on a project of mine and got an idea that
Route.resource
can be upgraded significantly by allowing it to be nested and allowing to specify a custom:param
.What it may add us, It may allow us to write routes like this:
This may generate these routes:
Not sure about the design, as it makes code a bit junky, maybe it would be cooler to be able to do something like this:
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions