I am trying to get the client\'s IP address in Laravel.
It is easy to get a client\'s IP in PHP by using $_SERVER[\"REMOTE_ADDR\"]. It is working fine
If you have multiple layer proxies just like CDN + Load Balancer.
Using Laravel Request::ip() function will get right-most proxy IP but not client IP.
You may try following solution.
app/Http/Middleware/TrustProxies.php
protected $proxies = ['0.0.0.0/0'];
Reference: https://github.com/fideloper/TrustedProxy/issues/107#issuecomment-373065215