Documentation
    Preparing search index...

    Group class exposes the API to take action on a group of routes. The group routes must be pre-defined using the constructor.

    Hierarchy

    • default
      • RouteGroup
    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    routes: (
        | Route<any>
        | BriskRoute
        | RouteGroup
        | RouteResource<ResourceActionNames>
    )[]

    Array of routes that belong to this group

    Methods

    • Define route param matcher

      Route.group(() => {
      }).where('id', /^[0-9]+/)

      Parameters

      • param: string

        The parameter name to match

      • matcher: string | RegExp | RouteMatcher

        The matcher pattern (RegExp, string, or RouteMatcher)

      Returns this

      Current RouteGroup instance for method chaining

    • Define prefix all the routes in the group.

      Route.group(() => {
      }).prefix('v1')

      Parameters

      • prefix: string

        The prefix to add to all routes in the group

      Returns this

      Current RouteGroup instance for method chaining

    • Define domain for all the routes.

      Route.group(() => {
      }).domain(':name.adonisjs.com')

      Parameters

      • domain: string

        The domain pattern for all routes in the group

      Returns this

      Current RouteGroup instance for method chaining

    • Prepend name to the routes name.

      Route.group(() => {
      }).as('version1')

      Parameters

      • name: string

        The name to prepend to all route names in the group

      Returns this

      Current RouteGroup instance for method chaining