Documentation
    Preparing search index...

    URL builder class is used to create URIs for pre-registered routes.

    const builder = new UrlBuilder(encryption, routeFinder)

    builder
    .qs({ sort: 'id' })
    .params([category.id])
    .make('categories.posts.index')

    Instead use "@adonisjs/core/services/url_builder" instead

    Index

    Constructors

    Methods

    • Prefix a custom base URL to the final URI

      Parameters

      • url: string

      Returns this

      Instead use "@adonisjs/core/services/url_builder" instead

    • Disable route lookup. Calling this method considers the "identifier" as the route pattern

      Returns this

      Instead use "@adonisjs/core/services/url_builder" instead

    • Append query string to the final URI

      Parameters

      • OptionalqueryString: Record<string, any>

      Returns this

      Instead use "@adonisjs/core/services/url_builder" instead

    • Specify params to apply to the route pattern

      Parameters

      • Optionalparams: any[] | Record<string, any>

      Returns this

      Instead use "@adonisjs/core/services/url_builder" instead

    • Generate URL for the given route identifier. The identifier can be the route name, controller.method name or the route pattern itself.

      Parameters

      • identifier: string

        Route identifier to generate URL for

      Returns string

      Generated URL string

      Instead use "@adonisjs/core/services/url_builder" instead

    • Generate a signed URL for the given route identifier. The identifier can be the route name, controller.method name or the route pattern itself.

      Parameters

      • identifier: string
      • Optionaloptions: { expiresIn?: string | number; purpose?: string }

      Returns string

      Instead use "@adonisjs/core/services/url_builder" instead