Configuration

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

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

404

Redirect

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

'redirect' => env('404_REDIRECT')
config(['streams::404.redirect' => $redirect]);
404_REDIRECT=/404

Addons

Types

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

'types' => [
    'field_type',
    'extension',
    'module',
    'plugin',
    'theme',
],
config(['streams::addons.types' => (array)$types]);

Paths

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

'paths' => [
    //vendor/anomaly/fancy-field_type'
],
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}.

'paths' => [
    //app/addons'
],
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.

'eager' => [
    //'core/anomaly/redirects-module'
],
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.

'deferred' => [
    //'core/anomaly/pages-module'
],
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.

'paths' => [
    //'example' => 'some/local/path',
    //'s3'      => 'https://region.amazonaws.com/bucket'
],
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.

'version' => env('VERSION_ASSETS', true),
config(['streams::assets.version' => false);
VERSION_ASSETS=false

Countries

Available

Specify the available countries for the application.

'available' => [
    //
],

Submit Country Configuration

Common

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

'common' => explode(',', env('COMMON_COUNTRIES', 'US')),
config(['streams::countries.common' => ['US', 'CA']);
COMMON_COUNTRIES=US,CA

Default

Specify the default country for the application.

'default' => env('DEFAULT_COUNTRY', 'US'),
config(['streams::countries.default' => 'CA');
DEFAULT_COUNTRY=CA

Currencies

Supported

Specify the supported currencies for the application.

'supported' => [
    //
],

Submit Currency Configuration

Enabled

Specify the enabled currencies for the application.

'enabled' => explode(',', env('ENABLED_CURRENCIES', 'USD')),
config(['streams::currencies.enabled' => ['USD']);
COMMON_CURRENCIES=USD,CA

Default

Specify the default currency for the application.

'default' => env('DEFAULT_CURRENCY', 'USD'),
config(['streams::currencies.default' => 'USD');
DEFAULT_CURRENCY=USD

Database

Cache

Enable or disable the database cache system.

Database Query Caching

'cache' => env('DB_CACHE', false),
config(['streams::database.cache' => true);
DB_CACHE=true

TTL

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

Database Query Caching

'ttl' => env('DB_TTL', 3600),
config(['streams::database.ttl' => 3600);
DB_TTL=3600

Datetime

Date Format

Specify the default date_format for the application.

PHP Date Format

'date_format' => env('DATE_FORMAT', 'm/d/Y'),
config(['streams::datetime.date_format' => 'm/d/Y');
DATE_FORMAT="m/d/Y"

Time Format

Specify the default time_format for the application.

PHP Date Format

'time_format' => env('TIME_FORMAT', 'g:i A'),
config(['streams::datetime.time_format' => 'g:i A');
TIME_FORMAT="g:i A"

Default Timezone

Specify the default_timezone for the application.

'default_timezone' => env('DEFAULT_TIMEZONE', date_default_timezone_get()),
config(['streams::datetime.default_timezone' => 'America/Chicago');
DEFAULT_TIMEZONE=America/Chicago

Database Timezone

Specify the database_timezone for the application's database.

'database_timezone' => env('DATABASE_TIMEZONE', date_default_timezone_get()),
config(['streams::datetime.database_timezone' => 'America/Chicago');
DATABASE_TIMEZONE=America/Chicago

Httpcache

Enabled

Specify if httpcache is enabled for the application.

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

HTTP cache can not be enabled at runtime.

TTL

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

'ttl' => env('HTTP_CACHE_TTL', 3600),
HTTPCACHE_TTL=3600

Excluded

Specify excluded paths for httpcache.

'excluded' => explode(',', env('HTTP_CACHE_EXCLUDED', '')),
HTTP_CACHE_EXCLUDED=/contact,/json/stock-quote

Excluded

Specify excluded paths for httpcache.

'excluded' => explode(',', env('HTTP_CACHE_EXCLUDED', '')),
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.

'rules' => explode(',', env('HTTP_CACHE_RULES', '')),
HTTP_CACHE_RULES=/ 600,/posts 86400

Images

Quality

Specify the default quality of the image processor.

Displaying Images

'quality' => env('IMAGE_QUALITY', 80),
config(['streams::images.quality' => 80);
IMAGE_QUALITY=80

Paths

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

'paths' => [
    //'example' => 'some/local/path',
    //'s3'      => 'https://region.amazonaws.com/bucket'
],
config(['streams::images.paths' => (array)$paths]);

Macros

Define image macros by name.

Image Macros

'macros' => [
    'mobile_optimized' => [
        'resize'  => [640],
        'quality' => 60,
    ],
    'tablet_optimized' => [
        'resize'  => [900],
        'quality' => 75,
    ],
],
config(['streams::images.macros' => (array)$macros]);

Auto Alts

Specify whether you want to enable automatic alt tag generation.

'auto_alt' => env('IMAGE_ALTS', true),
config(['streams::images.auto_alt' => true]);
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.

'version' => env('VERSION_IMAGES', true),
config(['streams::images.version' => true);
VERSION_IMAGES=true

Interlace

Specify whether to automatically interlace JPG images.

'interlace' => env('IMAGE_INTERLACE', true),
config(['streams::images.interlace' => true);
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.
'hint' => env('LOCALE_HINTS', true),
config(['streams::locales.hint' => true);
LOCALE_HINTS=true

Enabled

Specify the enabled locales for the application.

'enabled' => explode(',', env('ENABLED_LOCALES', 'en')),
config(['streams::locales.enabled' => ['en', 'fr']);
ENABLED_LOCALES=en,fr

Default

Specify the default locale for the application.

By default this configuration accounts for default Laravel configuration as well.

'default' => env('DEFAULT_LOCALE', env('LOCALE', 'en')),
config(['streams::locales.default' => 'en');
DEFAULT_LOCALE=en

Supported

Specify the supported locales for the application.

'supported' => [
    //
],

Submit Localizations

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.

'enabled' => env('MAINTENANCE_MODE', false),
config(['streams::maintenance.enabled' => true);
MAINTENANCE_MODE=true

IP Whitelist

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

'ip_whitelist' => explode(',', env('IP_WHITELIST')),
config(['streams::maintenance.ip_whitelist' => (array)$ips);
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.

'auth' => env('MAINTENANCE_AUTH', false)
config(['streams::maintenance.auth' => false);
MAINTENANCE_AUTH=true

Security

CSRF Exclusions

Specify the URI paths to exclude from CSRF protection.

CSRF Protection

'csrf' => [
    'except' => [
        // /api/example
    ],
],
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.

'force_ssl' => env('FORCE_SSL', false),
config(['streams::system.force_ssl' => false);
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.

'domain' => env('APPLICATION_DOMAIN', config('app.url', 'localhost')),
config(['streams::system.domain' => 'domain');
APPLICATION_DOMAIN=example.com

Domain Prefix

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

'domain_prefix' => env('DOMAIN_PREFIX', 'ignore'),
config(['streams::system.domain_prefix' => 'non-www');
DOMAIN_PREFIX=non-www

Per Page

Specify the default per_page value to use for pagination.

'per_page' => env('RESULTS_PER_PAGE', 15),
config(['streams::system.per_page' => 15);
RESULTS_PER_PAGE=15

Unit System

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

'unit_system' => env('UNIT_SYSTEM', 'imperial'),
config(['streams::system.unit_system' => 'imperial');
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.

'lazy_translations' => env('LAZY_TRANSLATIONS', false),
config(['streams::system.lazy_translations' => true);
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.

'locking_enabled' => env('LOCKING_ENABLED', true),
config(['streams::system.locking_enabled' => true);
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

'versioning_enabled' => env('VERSIONING_ENABLED', true),
config(['streams::system.versioning_enabled' => true);
LOCKING_ENABLED=true

Themes

Admin

Specify the default admin theme.

'admin' => env('ADMIN_THEME', 'anomaly.theme.anomaly'),
config(['streams::themes.admin' => 'anomaly.theme.anomaly');
ADMIN_THEME=anomaly.theme.anomaly

Standard

Specify the default standard (public facing) theme.

'standard' => env('STANDARD_THEME', 'anomaly.theme.starter'),
config(['streams::themes.standard' => 'anomaly.theme.starter');
STANDARD_THEME=anomaly.theme.starter