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.