Skip to content

Laravel Cloudflare

Active
monicahq/laravel-cloudflare

Add Cloudflare's IP ranges to Laravel's trusted proxies so request IPs and HTTPS detection are correct behind Cloudflare.

View on GitHub
Stars
351
Forks
33
Watchers
351
Open issues
7

Overview

laravel-cloudflare adds Cloudflare’s IP addresses to Laravel’s trusted proxies, so $request->ip() returns the real visitor IP and HTTPS is detected correctly when your app sits behind Cloudflare.

Installation

composer require monicahq/laravel-cloudflare

Then replace Laravel’s TrustProxies middleware with the package’s middleware in bootstrap/app.php.

Customizing

Call LaravelCloudflare::getProxiesUsing() — typically in your AppServiceProvider — to change how the proxy list is resolved.

Similar open-source projects, ranked by shared categories and tags.

All Web Framework projects →