Chapter 8 of 15

Configuration and environments.

YAML files feed the typed configuration system, and a manifest decides which files are loaded.

Config manifest

app/Config/Config.yaml lists only the configuration files an application actually uses. The optional shared section loads for both HTTP and CLI; equally optional http and cli sections add entrypoint-specific configuration.

app/Config/Config.yaml
shared:
  - App
  - Providers
  - Localization
http:
  - HtmlMinify
cli:
  - Commands

You can omit the manifest when the application has no configuration of its own. Empty sections are unnecessary, and undeclared files are not discovered implicitly. Routes are loaded separately from Routing.php.

Environment values

Reference environment variables through YAML $env directives with a type and optional default. Keep secrets out of the repository.

app/Config/App.yaml
module: app
config:
  base_url:
    $env: APP_BASE_URL
    type: string
    default: http://localhost
  secret:
    $env: APP_SECRET
    type: string

Production uses a verified compiled config cache; YAML and environment variables remain its source.

Detailed technical documentation on GitHub