Creates a new RouteGroup instance
Array of routes that belong to this group
Define route param matcher
Route.group(() => {
}).where('id', /^[0-9]+/)
The parameter name to match
The matcher pattern (RegExp, string, or RouteMatcher)
Current RouteGroup instance for method chaining
Define prefix all the routes in the group.
Route.group(() => {
}).prefix('v1')
The prefix to add to all routes in the group
Current RouteGroup instance for method chaining
Define domain for all the routes.
Route.group(() => {
}).domain(':name.adonisjs.com')
The domain pattern for all routes in the group
Current RouteGroup instance for method chaining
Prepend name to the routes name.
Route.group(() => {
}).as('version1')
The name to prepend to all route names in the group
Current RouteGroup instance for method chaining
Prepend an array of middleware to all routes middleware.
Route.group(() => {
}).use(middleware.auth())
Middleware function(s) to apply to all routes in the group
Current RouteGroup instance for method chaining
Alias for RouteGroup.use
Middleware function(s) to apply to all routes in the group
Current RouteGroup instance for method chaining
Group class exposes the API to take action on a group of routes. The group routes must be pre-defined using the constructor.