Custom params for router.resource() in Adonisjs V6 #4819
-
router.resource('/streaming-video', StreamingVideoController).params({ The params() ain't working for changing the default param by router.resource() The show() is still using :id as default params instead of :slug. Please correct me if I misunderstood the implementation. The prompt I got |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @Heng229! 👋🏻 When defining custom names, the key in the object should match the resource you're renaming. In your case, that would be 📚 https://docs.adonisjs.com/guides/basics/controllers#renaming-resource-params |
Beta Was this translation helpful? Give feedback.
Hey @Heng229! 👋🏻
When defining custom names, the key in the object should match the resource you're renaming. In your case, that would be
privacy-policy
instead ofshow
.📚 https://docs.adonisjs.com/guides/basics/controllers#renaming-resource-params