Skip to content

Configuration

env()

env() — returns any

Available in: controller, model, mapper, migrator, migration, tabledefinition Category: Miscellaneous Functions

Returns the value of an environment variable. Checks application.env (loaded from .env files) first, then falls back to system environment variables (server.system.environment). Returns the default if the variable is not found in either location.

NameTypeRequiredDefaultDescription
namestringyes—The environment variable name to look up.
defaultanyno—Value to return if the variable is not found.