Open-Source Wikis

/

Laravel

/

Reference

/

Configuration

laravel/laravel

Configuration

Every environment variable the skeleton uses, the config key it lands at, and its default. This page is the merge of .env.example and the env(...) calls scattered across config/*.php.

Reading order

The framework resolves a setting in this order on every request (unless config is cached):

  1. .env (or .env.<env> for environment-specific overrides)
  2. The PHP environment (set by your shell, web server, or container runtime)
  3. The env('KEY', 'default') call inside the matching config/*.php file
  4. The application code reading via config('section.key')

If php artisan config:cache has been run, the entire config/ tree is baked into bootstrap/cache/config.php and steps 1-3 happen exactly once at cache time. After that, only step 4 runs at request time.

App (config/app.php)

Env var Config key Default
APP_NAME app.name Laravel
APP_ENV app.env production
APP_DEBUG app.debug false
APP_URL app.url http://localhost
APP_LOCALE app.locale en
APP_FALLBACK_LOCALE app.fallback_locale en
APP_FAKER_LOCALE app.faker_locale en_US
APP_KEY app.key (required)
APP_PREVIOUS_KEYS app.previous_keys [] (comma-separated)
APP_MAINTENANCE_DRIVER app.maintenance.driver file
APP_MAINTENANCE_STORE app.maintenance.store database

Hard-coded (no env var):

  • app.timezone = UTC
  • app.cipher = AES-256-CBC

Auth (config/auth.php)

Env var Config key Default
AUTH_GUARD auth.defaults.guard web
AUTH_PASSWORD_BROKER auth.defaults.passwords users
AUTH_MODEL auth.providers.users.model App\Models\User::class
AUTH_PASSWORD_RESET_TOKEN_TABLE auth.passwords.users.table password_reset_tokens
AUTH_PASSWORD_TIMEOUT auth.password_timeout 10800 (3 hours, in seconds)

Hard-coded:

  • auth.guards.web.driver = session, provider = users
  • auth.providers.users.driver = eloquent
  • auth.passwords.users.expire = 60 (minutes)
  • auth.passwords.users.throttle = 60 (seconds)

Cache (config/cache.php)

Env var Config key Default
CACHE_STORE cache.default database
CACHE_PREFIX cache.prefix <slugified-app-name>-cache-
DB_CACHE_CONNECTION cache.stores.database.connection (null — use default DB connection)
DB_CACHE_TABLE cache.stores.database.table cache
DB_CACHE_LOCK_CONNECTION cache.stores.database.lock_connection (null)
DB_CACHE_LOCK_TABLE cache.stores.database.lock_table (null — uses cache_locks)
MEMCACHED_PERSISTENT_ID cache.stores.memcached.persistent_id (null)
MEMCACHED_USERNAME cache.stores.memcached.sasl[0] (null)
MEMCACHED_PASSWORD cache.stores.memcached.sasl[1] (null)
MEMCACHED_HOST cache.stores.memcached.servers[0].host 127.0.0.1
MEMCACHED_PORT cache.stores.memcached.servers[0].port 11211
REDIS_CACHE_CONNECTION cache.stores.redis.connection cache
REDIS_CACHE_LOCK_CONNECTION cache.stores.redis.lock_connection default
AWS_ACCESS_KEY_ID cache.stores.dynamodb.key (null)
AWS_SECRET_ACCESS_KEY cache.stores.dynamodb.secret (null)
AWS_DEFAULT_REGION cache.stores.dynamodb.region us-east-1
DYNAMODB_CACHE_TABLE cache.stores.dynamodb.table cache
DYNAMODB_ENDPOINT cache.stores.dynamodb.endpoint (null)

Hard-coded:

  • cache.serializable_classes = false (security default — see Security)

Database (config/database.php)

Env var Config key Default
DB_CONNECTION database.default sqlite
DB_URL database.connections.<conn>.url (null per conn)
DB_HOST database.connections.<conn>.host varies by conn
DB_PORT database.connections.<conn>.port varies by conn
DB_DATABASE database.connections.<conn>.database varies by conn
DB_USERNAME database.connections.<conn>.username root
DB_PASSWORD database.connections.<conn>.password `` (empty)
DB_SOCKET database.connections.mysql.unix_socket `` (empty)
DB_CHARSET database.connections.<conn>.charset utf8mb4 / utf8
DB_COLLATION database.connections.mysql.collation utf8mb4_unicode_ci
DB_FOREIGN_KEYS database.connections.sqlite.foreign_key_constraints true
DB_SSLMODE database.connections.pgsql.sslmode prefer
MYSQL_ATTR_SSL_CA database.connections.mysql.options[...] (null)
REDIS_CLIENT database.redis.client phpredis
REDIS_CLUSTER database.redis.options.cluster redis
REDIS_PREFIX database.redis.options.prefix <app>-database-
REDIS_PERSISTENT database.redis.options.persistent false
REDIS_URL database.redis.<conn>.url (null)
REDIS_HOST database.redis.<conn>.host 127.0.0.1
REDIS_USERNAME database.redis.<conn>.username (null)
REDIS_PASSWORD database.redis.<conn>.password (null)
REDIS_PORT database.redis.<conn>.port 6379
REDIS_DB database.redis.default.database 0
REDIS_CACHE_DB database.redis.cache.database 1
REDIS_MAX_RETRIES database.redis.<conn>.max_retries 3
REDIS_BACKOFF_ALGORITHM database.redis.<conn>.backoff_algorithm decorrelated_jitter
REDIS_BACKOFF_BASE database.redis.<conn>.backoff_base 100
REDIS_BACKOFF_CAP database.redis.<conn>.backoff_cap 1000

Filesystems (config/filesystems.php)

Env var Config key Default
FILESYSTEM_DISK filesystems.default local
APP_URL filesystems.disks.public.url (combined) http://localhost
AWS_ACCESS_KEY_ID filesystems.disks.s3.key (null)
AWS_SECRET_ACCESS_KEY filesystems.disks.s3.secret (null)
AWS_DEFAULT_REGION filesystems.disks.s3.region (null)
AWS_BUCKET filesystems.disks.s3.bucket (null)
AWS_URL filesystems.disks.s3.url (null)
AWS_ENDPOINT filesystems.disks.s3.endpoint (null)
AWS_USE_PATH_STYLE_ENDPOINT filesystems.disks.s3.use_path_style_endpoint false

Logging (config/logging.php)

Env var Config key Default
LOG_CHANNEL logging.default stack
LOG_STACK logging.channels.stack.channels single (comma-separated)
LOG_DEPRECATIONS_CHANNEL logging.deprecations.channel null
LOG_DEPRECATIONS_TRACE logging.deprecations.trace false
LOG_LEVEL logging.channels.<channel>.level debug (single/daily) / critical (slack)
LOG_DAILY_DAYS logging.channels.daily.days 14
LOG_SLACK_WEBHOOK_URL logging.channels.slack.url (null)
LOG_SLACK_USERNAME logging.channels.slack.username <APP_NAME> fallback (added in v12.12.2)
LOG_SLACK_EMOJI logging.channels.slack.emoji :boom:
LOG_PAPERTRAIL_HANDLER logging.channels.papertrail.handler Monolog\Handler\SyslogUdpHandler::class
PAPERTRAIL_URL logging.channels.papertrail.handler_with.host (null)
PAPERTRAIL_PORT logging.channels.papertrail.handler_with.port (null)
LOG_STDERR_FORMATTER logging.channels.stderr.formatter (null)
LOG_SYSLOG_FACILITY logging.channels.syslog.facility LOG_USER

Mail (config/mail.php)

Env var Config key Default
MAIL_MAILER mail.default log
MAIL_SCHEME mail.mailers.smtp.scheme (null)
MAIL_URL mail.mailers.smtp.url (null)
MAIL_HOST mail.mailers.smtp.host 127.0.0.1
MAIL_PORT mail.mailers.smtp.port 2525
MAIL_USERNAME mail.mailers.smtp.username (null)
MAIL_PASSWORD mail.mailers.smtp.password (null)
MAIL_EHLO_DOMAIN mail.mailers.smtp.local_domain hostname from APP_URL
MAIL_SENDMAIL_PATH mail.mailers.sendmail.path /usr/sbin/sendmail -bs -i
MAIL_LOG_CHANNEL mail.mailers.log.channel (null — uses default log channel)
MAIL_FROM_ADDRESS mail.from.address hello@example.com
MAIL_FROM_NAME mail.from.name <APP_NAME> fallback (added in v12.12.0)

Queue (config/queue.php)

Env var Config key Default
QUEUE_CONNECTION queue.default database
DB_QUEUE_CONNECTION queue.connections.database.connection (null — default DB)
DB_QUEUE_TABLE queue.connections.database.table jobs
DB_QUEUE queue.connections.database.queue default
DB_QUEUE_RETRY_AFTER queue.connections.database.retry_after 90
BEANSTALKD_QUEUE_HOST queue.connections.beanstalkd.host localhost
BEANSTALKD_QUEUE queue.connections.beanstalkd.queue default
BEANSTALKD_QUEUE_RETRY_AFTER queue.connections.beanstalkd.retry_after 90
AWS_ACCESS_KEY_ID queue.connections.sqs.key (null)
AWS_SECRET_ACCESS_KEY queue.connections.sqs.secret (null)
SQS_PREFIX queue.connections.sqs.prefix https://sqs...
SQS_QUEUE queue.connections.sqs.queue default
SQS_SUFFIX queue.connections.sqs.suffix (null)
AWS_DEFAULT_REGION queue.connections.sqs.region us-east-1
REDIS_QUEUE_CONNECTION queue.connections.redis.connection default
REDIS_QUEUE queue.connections.redis.queue default
REDIS_QUEUE_RETRY_AFTER queue.connections.redis.retry_after 90
QUEUE_FAILED_DRIVER queue.failed.driver database-uuids

Services (config/services.php)

Env var Config key Default
POSTMARK_API_KEY services.postmark.key (null)
RESEND_API_KEY services.resend.key (null)
AWS_ACCESS_KEY_ID services.ses.key (null)
AWS_SECRET_ACCESS_KEY services.ses.secret (null)
AWS_DEFAULT_REGION services.ses.region us-east-1
SLACK_BOT_USER_OAUTH_TOKEN services.slack.notifications.bot_user_oauth_token (null)
SLACK_BOT_USER_DEFAULT_CHANNEL services.slack.notifications.channel (null)

Session (config/session.php)

Env var Config key Default
SESSION_DRIVER session.driver database
SESSION_LIFETIME session.lifetime 120
SESSION_EXPIRE_ON_CLOSE session.expire_on_close false
SESSION_ENCRYPT session.encrypt false
SESSION_CONNECTION session.connection (null — default DB connection)
SESSION_TABLE session.table sessions
SESSION_STORE session.store (null)
SESSION_COOKIE session.cookie <slug-app-name>-session
SESSION_PATH session.path /
SESSION_DOMAIN session.domain (null)
SESSION_SECURE_COOKIE session.secure (null — auto-detect from request)
SESSION_HTTP_ONLY session.http_only true
SESSION_SAME_SITE session.same_site lax
SESSION_PARTITIONED_COOKIE session.partitioned false

Hard-coded:

  • session.serialization = 'json'

Other

Env var Used by Default
BCRYPT_ROUNDS (framework — Illuminate\Hashing\BcryptHasher) 12
BROADCAST_CONNECTION (framework config/broadcasting.php — package-only) log
VITE_APP_NAME vite.config.js / Blade @vite directive ${APP_NAME}
PHP_CLI_SERVER_WORKERS PHP built-in server (when running php artisan serve) (commented out)

Variables with the same name appearing in multiple config files (e.g. AWS_ACCESS_KEY_ID is read by cache.php, filesystems.php, queue.php, and services.php) are deliberately shared — set the value once and every subsystem reads it.

For broader context on each subsystem, see Systems → Config.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Configuration – Laravel wiki | Factory