Skip to content

Cloudflare ​

EdgeTrust loads Cloudflare edge IP ranges from Cloudflare's official published lists.

Official sources ​

These endpoints are Cloudflare's documented source for proxy IP ranges used when restoring client IPs behind Cloudflare.

Enable ​

ini
EDGE_TRUST_PROVIDERS=cloudflare

TrustProxies ​

Once Cloudflare is enabled and EdgeTrust is wired into your TrustProxies middleware, Laravel will treat matching connecting IPs as trusted proxies and read X-Forwarded-* headers accordingly.

php
use Hosni\EdgeTrust\Facades\EdgeTrust;

$middleware->trustProxies(
    at: EdgeTrust::proxies(),
);

Exact integration patterns for Laravel 11+ bootstrap are covered in Trust Proxies.

Origin firewall reminder ​

Trusting Cloudflare IPs in Laravel is not the same as allowlisting Cloudflare at your origin firewall / security group. If attackers can reach your origin directly, they can spoof forwarded headers unless network-level controls restrict traffic to Cloudflare (or you use authenticated origin pulls / similar controls). See Origin firewall.

Sync ​

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

Omit --provider to sync all enabled providers.

Released under the MIT License.