@@ -85,7 +85,13 @@ export class RouteGroup<Context> extends Macroable implements RouteGroupContract
8585 }
8686
8787 /**
88- * Define Regex matchers for a given param for all the routes
88+ * Define Regex matchers for a given param for all the routes.
89+ *
90+ * @example
91+ * ```ts
92+ * Route.group(() => {
93+ * }).where('id', /^[0-9]+/)
94+ * ```
8995 */
9096 public where ( param : string , matcher : RegExp | string ) : this {
9197 this . routes . forEach ( ( route ) => {
@@ -96,7 +102,13 @@ export class RouteGroup<Context> extends Macroable implements RouteGroupContract
96102 }
97103
98104 /**
99- * Define prefix all the routes in the group
105+ * Define prefix all the routes in the group.
106+ *
107+ * @example
108+ * ```ts
109+ * Route.group(() => {
110+ * }).prefix('v1')
111+ * ```
100112 */
101113 public prefix ( prefix : string ) : this {
102114 this . routes . forEach ( ( route ) => {
@@ -107,7 +119,13 @@ export class RouteGroup<Context> extends Macroable implements RouteGroupContract
107119 }
108120
109121 /**
110- * Define domain for all the routes
122+ * Define domain for all the routes.
123+ *
124+ * @example
125+ * ```ts
126+ * Route.group(() => {
127+ * }).domain(':name.adonisjs.com')
128+ * ```
111129 */
112130 public domain ( domain : string ) : this {
113131 this . routes . forEach ( ( route ) => {
@@ -118,7 +136,13 @@ export class RouteGroup<Context> extends Macroable implements RouteGroupContract
118136 }
119137
120138 /**
121- * Prepend name to the routes name
139+ * Prepend name to the routes name.
140+ *
141+ * @example
142+ * ```ts
143+ * Route.group(() => {
144+ * }).as('version1')
145+ * ```
122146 */
123147 public as ( name : string ) : this {
124148 this . routes . forEach ( ( route ) => {
@@ -129,7 +153,13 @@ export class RouteGroup<Context> extends Macroable implements RouteGroupContract
129153 }
130154
131155 /**
132- * Prepend an array of middleware to all routes middleware
156+ * Prepend an array of middleware to all routes middleware.
157+ *
158+ * @example
159+ * ```ts
160+ * Route.group(() => {
161+ * }).middleware(['auth'])
162+ * ```
133163 */
134164 public middleware ( middleware : any | any [ ] ) : this {
135165 this . routes . forEach ( ( route ) => {
@@ -140,7 +170,13 @@ export class RouteGroup<Context> extends Macroable implements RouteGroupContract
140170 }
141171
142172 /**
143- * Define namespace for all the routes inside the group
173+ * Define namespace for all the routes inside the group.
174+ *
175+ * @example
176+ * ```ts
177+ * Route.group(() => {
178+ * }).namespace('App/Admin/Controllers')
179+ * ```
144180 */
145181 public namespace ( namespace : string ) : this {
146182 this . routes . forEach ( ( route ) => {
0 commit comments