---
title: Configuration
---

# Configuration

<div class="documentation__toc"></div>

## Introduction

The Streams Platform comes configured in such a way that you likely do not need to modify it in most cases.

### Settings Module

Many of these configurations are `bound` to settings and can be controlled from the Control Panel.

[Settings Module](/documentation/settings-module){.link}

### Preferences Module

Some of these configurations are `bound` to user specific preferences as well and can also be controlled from the Control Panel.

[Preferences Module](/documentation/preferences-module){.link}

## 404

### Redirect

Define the path/URL to `redirect` when displaying a 404 page. 404 errors will still be logged.

```php
'redirect' => env('404_REDIRECT')
```

```php
config(['streams::404.redirect' => $redirect]);
```

```bash
404_REDIRECT=/404
```


## Addons

### Types

The `types` configuration defines the addon types available to the system.

```php
'types' => [
    'field_type',
    'extension',
    'module',
    'plugin',
    'theme',
],
```

```php
config(['streams::addons.types' => (array)$types]);
```

### Paths

Specify additional addon `paths` to load. The path should be relative to your project's root directory.

```php
'paths' => [
    //vendor/anomaly/fancy-field_type'
],
```

```php
config(['streams::addons.paths' => (array)$paths]);
```

### Directories

Specify additional addon `directories` to scan. The directory should be relative to your project's root directory. Addons will need to be in sub-directories by `vendor` just as they normally would in `core` or `addons/{application}`.

```php
'paths' => [
    //app/addons'
],
```

```php
config(['streams::addons.directories' => (array)$directories]);
```

### Eager

Specify addons by path to load first. The path should be relative to your project's root directory.

```php
'eager' => [
    //'vendor/anomaly/redirects-module'
],
```

```php
config(['streams::addons.eager' => (array)$paths]);
```

### Deferred

Specify addons by path to load last. The path should be relative to your project's root directory.

```php
'deferred' => [
    //'vendor/anomaly/pages-module'
],
```

```php
config(['streams::addons.deferred' => (array)$paths]);
```


## Assets

### Paths

Specify additional asset prefixes by `hint`. The path should be relative to your project's root directory or a URL.

```php
'paths' => [
    //'example' => 'some/local/path',
    //'s3'      => 'https://region.amazonaws.com/bucket'
],
```

```php
config(['streams::assets.paths' => (array)$paths]);
```

### Version

Specify whether to version asset paths or not. When enabled the last modified timestamp will be appended as a query string to asset paths like `/app/default/assets/public/theme.js?v=1554498728`.

```php
'version' => env('VERSION_ASSETS', true),
```

```php
config(['streams::assets.version' => false);
```

```bash
VERSION_ASSETS=false
```


## Countries

### Available

Specify the `available` countries for the application.

```php
'available' => [
    //
],
```

[Submit Country Configuration](https://github.com/anomalylabs/streams-platform){.link}

### Common

Specify the `common` countries for the application. Common countries are often pushed to the top of lists to prevent excessive scrolling.

```php
'common' => explode(',', env('COMMON_COUNTRIES', 'US')),
```

```php
config(['streams::countries.common' => ['US', 'CA']);
```

```bash
COMMON_COUNTRIES=US,CA
```

### Default

Specify the `default` country for the application.

```php
'default' => env('DEFAULT_COUNTRY', 'US'),
```

```php
config(['streams::countries.default' => 'CA');
```

```bash
DEFAULT_COUNTRY=CA
```


## Currencies

### Supported

Specify the `supported` currencies for the application.

```php
'supported' => [
    //
],
```

[Submit Currency Configuration](https://github.com/anomalylabs/streams-platform){.link}

### Enabled

Specify the `enabled` currencies for the application.

```php
'enabled' => explode(',', env('ENABLED_CURRENCIES', 'USD')),
```

```php
config(['streams::currencies.enabled' => ['USD']);
```

```bash
COMMON_CURRENCIES=USD,CA
```

### Default

Specify the `default` currency for the application.

```php
'default' => env('DEFAULT_CURRENCY', 'USD'),
```

```php
config(['streams::currencies.default' => 'USD');
```

```bash
DEFAULT_CURRENCY=USD
```


## Database

### Cache

Enable or disable the database `cache` system.

[Database Query Caching](../database/query-builder#database-cache){.link}

```php
'cache' => env('DB_CACHE', false),
```

```php
config(['streams::database.cache' => true);
```

```bash
DB_CACHE=true
```

### TTL

Specify the default `ttl` for database cache. The default is 1 hour.

[Database Query Caching](../database/query-builder#database-cache){.link}

```php
'ttl' => env('DB_TTL', 3600),
```

```php
config(['streams::database.ttl' => 3600);
```

```bash
DB_TTL=3600
```


## Datetime

### Date Format

Specify the default `date_format` for the application.

[PHP Date Format](https://www.php.net/manual/en/function.date.php#refsect1-function.date-parameters){.link}

```php
'date_format' => env('DATE_FORMAT', 'm/d/Y'),
```

```php
config(['streams::datetime.date_format' => 'm/d/Y');
```

```bash
DATE_FORMAT="m/d/Y"
```

### Time Format

Specify the default `time_format` for the application.

[PHP Date Format](https://www.php.net/manual/en/function.date.php#refsect1-function.date-parameters){.link}

```php
'time_format' => env('TIME_FORMAT', 'g:i A'),
```

```php
config(['streams::datetime.time_format' => 'g:i A');
```

```bash
TIME_FORMAT="g:i A"
```

### Default Timezone

Specify the `default_timezone` for the application.

```php
'default_timezone' => env('DEFAULT_TIMEZONE', date_default_timezone_get()),
```

```php
config(['streams::datetime.default_timezone' => 'America/Chicago');
```

```bash
DEFAULT_TIMEZONE=America/Chicago
```

### Database Timezone

Specify the `database_timezone` for the application's database.

```php
'database_timezone' => env('DATABASE_TIMEZONE', date_default_timezone_get()),
```

```php
config(['streams::datetime.database_timezone' => 'America/Chicago');
```

```bash
DATABASE_TIMEZONE=America/Chicago
```


## Httpcache

### Enabled

Specify if httpcache is `enabled` for the application.

```php
'enabled' => env('HTTP_CACHE', false),
```

> HTTP cache can not be enabled at runtime.{.warning}

### TTL

Specify default `ttl` for httpcache. The default is 1 hr.

```php
'ttl' => env('HTTP_CACHE_TTL', 3600),
```

```bash
HTTPCACHE_TTL=3600
```

### Excluded

Specify `excluded` paths for httpcache.

```php
'excluded' => explode(',', env('HTTP_CACHE_EXCLUDED', '')),
```

```bash
HTTP_CACHE_EXCLUDED=/contact,/json/stock-quote
```

### Excluded

Specify `excluded` paths for httpcache.

```php
'excluded' => explode(',', env('HTTP_CACHE_EXCLUDED', '')),
```

```bash
HTTP_CACHE_EXCLUDED=/contact,/json/stock-quote
```

### Timeout Rules

Specify timeout `rules` per path for httpcache.

Format rules as `{path} {ttl}` each on it's own line.

```php
'rules' => explode(',', env('HTTP_CACHE_RULES', '')),
```

```bash
HTTP_CACHE_RULES=/ 600,/posts 86400
```


## Images

### Quality

Specify the default `quality` of the image processor.

[Displaying Images](../front-end-development/images){.link}

```php
'quality' => env('IMAGE_QUALITY', 80),
```

```php
config(['streams::images.quality' => 80);
```

```bash
IMAGE_QUALITY=80
```

### Paths

Specify additional image prefixes by `hint`. The path should be relative to your project's root directory or a URL.

```php
'paths' => [
    //'example' => 'some/local/path',
    //'s3'      => 'https://region.amazonaws.com/bucket'
],
```

```php
config(['streams::images.paths' => (array)$paths]);
```

### Macros

Define image `macros` by name.

[Image Macros](../front-end-development/images#macros){.link}

```php
'macros' => [
    'mobile_optimized' => [
        'resize'  => [640],
        'quality' => 60,
    ],
    'tablet_optimized' => [
        'resize'  => [900],
        'quality' => 75,
    ],
],
```

```php
config(['streams::images.macros' => (array)$macros]);
```

### Auto Alts

Specify whether you want to enable automatic alt tag generation.

```php
'auto_alt' => env('IMAGE_ALTS', true),
```

```php
config(['streams::images.auto_alt' => true]);
```

```bash
IMAGE_ALTS=true
```

### Version

Specify whether to version image paths or not. When enabled the last modified timestamp will be appended as a query string to image paths like `/app/default/assets/public/logo.png?v=1554498728`.

```php
'version' => env('VERSION_IMAGES', true),
```

```php
config(['streams::images.version' => true);
```

```bash
VERSION_IMAGES=true
```

### Interlace

Specify whether to automatically `interlace` JPG images.

```php
'interlace' => env('IMAGE_INTERLACE', true),
```

```php
config(['streams::images.interlace' => true);
```

```bash
IMAGE_INTERLACE=true
```


## Locales

### Hint

Define where to look for an i18n locale `hint` to determine desired localization. Valid options are `true`, `false`, `domain` or `uri`

**Example:** `http://{locale}.domain.com/{locale}/{path}`

| Value | Behavior|
|-------|---------|
|`true`|Allow for URI and sub-domain hints.|
|`false`|No hinting. Manual control only.|
|`domain`|Allow sub-domain hints only.|
|`domain`|Allow URI hints only.|

```php
'hint' => env('LOCALE_HINTS', true),
```

```php
config(['streams::locales.hint' => true);
```

```bash
LOCALE_HINTS=true
```

### Enabled

Specify the `enabled` locales for the application.

```php
'enabled' => explode(',', env('ENABLED_LOCALES', 'en')),
```

```php
config(['streams::locales.enabled' => ['en', 'fr']);
```

```bash
ENABLED_LOCALES=en,fr
```

### Default

Specify the `default` locale for the application.

> By default this configuration accounts for default Laravel configuration as well.{.info}

```php
'default' => env('DEFAULT_LOCALE', env('LOCALE', 'en')),
```

```php
config(['streams::locales.default' => 'en');
```

```bash
DEFAULT_LOCALE=en
```

### Supported

Specify the `supported` locales for the application.

```php
'supported' => [
    //
],
```

[Submit Localizations](https://github.com/anomalylabs/streams-platform){.link}


## Maintenance

### Enabled

Specify if maintenance mode is `enabled` or not.

> Our maintenance mode is slightly different than Laravel's. The entire application is not brought down when enabled. Only the front-end.{.warning}

```php
'enabled' => env('MAINTENANCE_MODE', false),
```

```php
config(['streams::maintenance.enabled' => true);
```

```bash
MAINTENANCE_MODE=true
```

### IP Whitelist

Specify the `ip_whitelist` for maintenance mode. These IPs will not be blocked when maintenance mode is enabled.

```php
'ip_whitelist' => explode(',', env('IP_WHITELIST')),
```

```php
config(['streams::maintenance.ip_whitelist' => (array)$ips);
```

```bash
IP_WHITELIST=::1,3604:2d80:803b:8259:102:25b5:ba68:b903
```

### Auth

When enabled, a simple HTTP `auth` prompt will be presented to users on the front end when not logged in.

```php
'auth' => env('MAINTENANCE_AUTH', false)
```

```php
config(['streams::maintenance.auth' => false);
```

```bash
MAINTENANCE_AUTH=true
```


## Security

### CSRF Exclusions

Specify the URI paths to `exclude` from CSRF protection.

[CSRF Protection](/documentation/streams-platform/latest/the-basics/csrf-protection){.link}

```php
'csrf' => [
    'except' => [
        // /api/example
    ],
],
```

```php
config(['streams::security.csrf.except' => (array)$paths);
```


## System

### Force SSL

Specify whether to `force_ssl` or not.

> This can be helpful for enforcing SSL behind load balancers where it's harder to detect desired SSL state.{.tip}

```php
'force_ssl' => env('FORCE_SSL', false),
```

```php
config(['streams::system.force_ssl' => false);
```

```bash
FORCE_SSL=false
```

### Domain

Specify the default `domain` for the application.

> This is primarily used during CLI operations where a request is not present to determine appropriate URLs.{.tip}

```php
'domain' => env('APPLICATION_DOMAIN', config('app.url', 'localhost')),
```

```php
config(['streams::system.domain' => 'domain');
```

```bash
APPLICATION_DOMAIN=example.com
```

### Domain Prefix

Specify the `domain_prefix` to enforce if any. Valid options are `ignore`, `www`, and `non-www`.

```php
'domain_prefix' => env('DOMAIN_PREFIX', 'ignore'),
```

```php
config(['streams::system.domain_prefix' => 'non-www');
```

```bash
DOMAIN_PREFIX=non-www
```

### Per Page

Specify the default `per_page` value to use for pagination.

```php
'per_page' => env('RESULTS_PER_PAGE', 15),
```

```php
config(['streams::system.per_page' => 15);
```

```bash
RESULTS_PER_PAGE=15
```

### Unit System

Specify the default `unit_system` to use for the application. Valid options are `imperial` or `metric`.

```php
'unit_system' => env('UNIT_SYSTEM', 'imperial'),
```

```php
config(['streams::system.unit_system' => 'imperial');
```

```bash
UNIT_SYSTEM=imperial
```

### Lazy Translations

Specify whether to enable `lazy_translations` or not. Lazy translations will make the system try and guess labels and strings where it can instead of displaying raw translation keys where translation information is not available.

> This can be helpful during development when fields are often changing.{.tip}

```php
'lazy_translations' => env('LAZY_TRANSLATIONS', false),
```

```php
config(['streams::system.lazy_translations' => true);
```

```bash
LAZY_TRANSLATIONS=false
```

### Content Locking

Specify whether to enabled content locking or not. When `locking_enabled` is `true` then the system will prevent users from editing the same information at the same time.

```php
'locking_enabled' => env('LOCKING_ENABLED', true),
```

```php
config(['streams::system.locking_enabled' => true);
```

```bash
LOCKING_ENABLED=true
```

### Content Versioning

Specify whether to enabled content versioning or not. When `versioning_enabled` is `true` then the system will automatically track changes to `versionable` models.

[Versioning](../core-concepts/versioning){.link}

```php
'versioning_enabled' => env('VERSIONING_ENABLED', true),
```

```php
config(['streams::system.versioning_enabled' => true);
```

```bash
LOCKING_ENABLED=true
```

## Themes

### Admin

Specify the default `admin` theme.

```php
'admin' => env('ADMIN_THEME', 'pyrocms.theme.accelerant'),
```

```php
config(['streams::themes.admin' => 'pyrocms.theme.accelerant');
```

```bash
ADMIN_THEME=pyrocms.theme.accelerant
```

### Standard

Specify the default `standard` (public facing) theme.

```php
'standard' => env('STANDARD_THEME', 'pyrocms.theme.starter'),
```

```php
config(['streams::themes.standard' => 'pyrocms.theme.starter');
```

```bash
STANDARD_THEME=pyrocms.theme.starter
```
