Guide

Configuration & Environment

The YAML manifest, typed configuration definitions, environment values, and the production config cache.

Configuration manifest

Start in app/Config/Config.yaml. It defines shared, HTTP, and CLI modules. YAML is the application configuration input and the framework maps it into typed config definitions.

example.php
shared:
  - App
  - Providers
  - View
http:
  - Error
cli:
  - Commands

Providers and configuration modules

Keep provider registration in Providers.yaml and settings for individual features in separate YAML modules such as Api.yaml, View.yaml, or Upload.yaml.

example.php
module: providers
config:
  providers:
    - App\Providers\AppServiceProvider

Environment values and config cache

Read environment values through YAML $env directives. In production, the framework compiles resolved configuration into storage/cache/framework/config, while YAML files and the environment remain the source of truth.

example.php
module: app
config:
  base_url:
    $env: APP_BASE_URL
    type: string
    default: http://localhost