Skip to content

Configuration

Configuration

  • addFormat() — Adds a new MIME type to your Wheels application for use with responding to multiple formats.
  • api() — Scope routes under an API path prefix. Shorthand for .group(path=“api”, name=“api”, …). Typically used in
  • collection() — A collection route doesn’t require an id because it acts on a collection of objects.
  • constraints() — Set variable patterns to use for matching.
  • controller() — Considered deprecated as this doesn’t conform to RESTful routing principles; Try not to use this.
  • delete() — Create a route that matches a URL requiring an HTTP DELETE method. We recommend using this matcher to expos
  • end() — Call this to end a nested routing block or the entire route configuration. This method is chained on a sequence of routi
  • env() — Returns the value of an environment variable. Checks application.env (loaded from .env files) first, then falls back to
  • get() — Returns the current setting for the supplied Wheels setting or the current default for the supplied Wheels function argu
  • get() — Create a route that matches a URL requiring an HTTP GET method. We recommend only using this matcher to exp
  • group() — Group routes together with shared attributes like path prefix, name prefix, and constraints without implying a controlle
  • health() — Register a health check route at /health (or a custom path). Returns a JSON response with status and timest
  • mapper() — Returns the mapper object used to configure your application’s routes. Usually you will use this method in config/
  • member() — Scope routes within a nested resource which require use of the primary key as part of the URL pattern;
  • namespace() — Scopes any the controllers for any routes configured within this block to a subfolder (package) and also adds the packag
  • package() — Scopes any the controllers for any routes configured within this block to a subfolder (package) without adding the packa
  • patch() — Create a route that matches a URL requiring an HTTP PATCH method. We recommend using this matcher to expose
  • post() — Create a route that matches a URL requiring an HTTP POST method. We recommend using this matcher to expose
  • put() — Create a route that matches a URL requiring an HTTP PUT method. We recommend using this matcher to expose a
  • registerOnError() — Registers a callback function to be invoked when an unhandled error occurs.
  • resource() — Create a group of routes that exposes actions for manipulating a singular resource. A singular resource exposes URL patt
  • resources() — Create a group of routes that exposes actions for manipulating a collection of resources. A plural resource exposes URL
  • root() — Create a route that matches the root of its current context. This mapper can be used for the application’s web root (or
  • scope() — Set any number of parameters to be inherited by mappers called within this matcher’s block. For example, set a package o
  • set() — Use to configure a global setting or set a default for a function.
  • switchTenant() — Switches the active tenant mid-request. Throws if the current tenant is locked
  • tenant() — Returns the current tenant struct, or an empty struct if no tenant is active.
  • version() — Scope routes under a version prefix within an API group. Creates a URL path prefix of v{number} (e.g., <cod
  • whereAlpha() — Constrain a route variable to only match alphabetic characters (a-zA-Z). Similar to Laravel’s whereAlpha()
  • whereAlphaNumeric() — Constrain a route variable to only match alphanumeric characters (a-zA-Z0-9). Similar to Laravel’s whereAlphaNumer
  • whereIn() — Constrain a route variable to only match one of a set of allowed values. Similar to an enum constraint.
  • whereMatch() — Constrain a route variable with a custom regex pattern.
  • whereNumber() — Constrain a route variable to only match numeric values (digits). Similar to Laravel’s whereNumber() or ASP
  • whereSlug() — Constrain a route variable to only match URL-friendly slug values (lowercase alphanumeric and hyphens).
  • whereUuid() — Constrain a route variable to only match UUID values. Similar to ASP.NET’s :guid constraint.
  • wildcard() — Special wildcard matching generates routes with `