You’ll need to login to your admin area, navigate to Setup > General Setting > Security > Proxy IP Header and add in X_FORWARDED_FOR please also add in the CloudFlare IPs to the Trusted Proxies https://www.cloudflare.com/ips/
Configure Trusted Proxy Setting in whmcs with Cloudflare DNS.
https://docs.whmcs.com/Trusted_Proxy_Settings