Skip to content

Runtime Sync ​

Runtime synchronization refreshes provider IP ranges from official sources into Laravel's cache (and related last-known-good storage) without waiting for a Composer package release.

When to use it ​

ModeSync role
runtimePrimary way ranges stay fresh
hybridPreferred path; falls back to last-known-good / bundled archives on failure
bundledOptional offline refresh via CI / update-proxies workflow writing archives

Artisan ​

bash
php artisan edge-trust:sync
php artisan edge-trust:sync --provider=cloudflare
php artisan edge-trust:sync --force

edge-trust:update is an alias of sync.

--force bypasses max-change-percent sanity checks when you intentionally accept a large swing.

Scheduling ​

By default the service provider can register a scheduled sync (sync.schedule / EDGE_TRUST_SCHEDULE_SYNC). See Scheduling.

Manual registration:

php
use Illuminate\Support\Facades\Schedule;

Schedule::command('edge-trust:sync')->cron('0 */6 * * *');

Cache interaction ​

Successful syncs warm the cache using cache.ttl and retain last-known-good data up to cache.stale_ttl. Concurrent syncs are serialized with cache.lock_seconds.

HTTP fetches never run on every web request — only via sync / cold cache refresh paths. Details: Caching.

Failure behavior ​

  • Invalid payloads are rejected; previous good data is preserved.
  • Hybrid mode continues serving last-known-good or bundled archives.
  • Prefer all-or-nothing updates in CI (update-proxies workflow) when publishing new bundled archives.

Observability ​

bash
php artisan edge-trust:status
php artisan edge-trust:status --json

Enable logging via logging.enabled / EDGE_TRUST_LOGGING.

Released under the MIT License.