Best way to configure Cloudflare as Trusted Proxy In Laravel Application

Wonder what could be best way to configure the Cloudflare as trusted proxy in laravel.

  1. Hardcode all Cloudflare’s ip address is probably one of the easiest way.
  2. Using a package that retrieves Cloudflare’s IP blocks, and stores them in cache.

Hello Kiran,

First of all, welcome to Cleavr Forum.

I think the best option here would be to go with a package so that you don’t have to worry about updating the IPs when they’re changed.

I wonder if this is any helpful: Laravel HTTPS | Fixed | Laravel CSS Not Working |JS Not Working | Assets |Force HTTPS |Mixed Content - YouTube

Thanks to @willmkt for sharing this tip via Feedmas.