Skip to content

Configuration ​

Prefer .env so you do not have to publish config/edge-trust.php. Publish only when you need nested options (custom provider classes, per-provider validation maps, header bitfields).

Mode ​

ini
EDGE_TRUST_MODE=hybrid
ModeDescription
bundledUse only shipped archives. No outbound HTTP for IP lists at request time.
runtimeFetch from provider sources when resolving ranges (subject to cache TTLs).
hybridPrefer fresh runtime data; fall back to last-known-good, then bundled archives.

See Modes for trade-offs.

Providers ​

ini
EDGE_TRUST_PROVIDERS=cloudflare
# EDGE_TRUST_PROVIDERS=cloudflare,aws_cloudfront,fastly
# EDGE_TRUST_PROVIDERS=*
ValueEffect
unsetDefaults to cloudflare
comma-separated keysOnly those providers
empty or *Every registered provider

Only enable providers that sit in front of your origin. Trusting unused ranges widens the set of IPs Laravel will treat as proxies.

Override a provider's resolution source in published config when needed:

php
'provider_sources' => [
    // 'cloudflare' => 'provider', // bundled | provider | registry | custom
],

Custom ranges ​

ini
EDGE_TRUST_CUSTOM_RANGES=203.0.113.0/24,2001:db8::/32
EDGE_TRUST_EXCLUDE_RANGES=198.51.100.0/24

See Custom IP ranges.

Cache ​

ini
EDGE_TRUST_CACHE_STORE=
EDGE_TRUST_CACHE_PREFIX=edge-trust
EDGE_TRUST_CACHE_TTL=86400
EDGE_TRUST_CACHE_STALE_TTL=604800
EDGE_TRUST_SYNC_LOCK=120

Resolved ranges are cached after a successful load. HTTP fetches are never performed on every HTTP request — see Caching.

Validation & fallbacks ​

ini
EDGE_TRUST_REJECT_NON_GLOBAL=true
EDGE_TRUST_REJECT_NON_GLOBAL_CUSTOM=false
EDGE_TRUST_VERIFY_CHECKSUMS=true
EDGE_TRUST_USE_LAST_KNOWN_GOOD=true
EDGE_TRUST_USE_BUNDLED=true
EDGE_TRUST_FAIL_OPEN_EMPTY=false

Per-provider min_prefixes / max_change_percent maps stay in published config. Details: Validation and Security.

Environment variables ​

ini
EDGE_TRUST_MODE=hybrid
EDGE_TRUST_PROVIDERS=cloudflare
EDGE_TRUST_CUSTOM_RANGES=
EDGE_TRUST_EXCLUDE_RANGES=
EDGE_TRUST_CACHE_STORE=
EDGE_TRUST_CACHE_PREFIX=edge-trust
EDGE_TRUST_CACHE_TTL=86400
EDGE_TRUST_CACHE_STALE_TTL=604800
EDGE_TRUST_SYNC_LOCK=120
EDGE_TRUST_HTTP_TIMEOUT=30
EDGE_TRUST_HTTP_CONNECT_TIMEOUT=10
EDGE_TRUST_REGISTRY_URL=
EDGE_TRUST_ARCHIVES_PATH=
EDGE_TRUST_VERIFY_CHECKSUMS=true
EDGE_TRUST_REJECT_NON_GLOBAL=true
EDGE_TRUST_REJECT_NON_GLOBAL_CUSTOM=false
EDGE_TRUST_USE_LAST_KNOWN_GOOD=true
EDGE_TRUST_USE_BUNDLED=true
EDGE_TRUST_FAIL_OPEN_EMPTY=false
EDGE_TRUST_SCHEDULE_SYNC=true
EDGE_TRUST_SYNC_CRON="0 */6 * * *"
EDGE_TRUST_SYNC_FORCE=false
EDGE_TRUST_LOGGING=true
EDGE_TRUST_LOG_CHANNEL=

Full key reference: Configuration reference.

Released under the MIT License.