Request::getClientIp PHP Method

getClientIp() public static method

This method can read the client IP address from the "X-Forwarded-For" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-For" header value is a comma+space separated list of IP addresses, the left-most being the original client, and each successive proxy that passed the request adding the IP address where it received the request from. If your reverse proxy uses a different header name than "X-Forwarded-For", ("Client-Ip" for instance), configure it via "setTrustedHeaderName()" with the "client-ip" key.
See also: getClientIps()
See also: http://en.wikipedia.org/wiki/X-Forwarded-For
public static getClientIp ( ) : string
return string The client IP address
        public static function getClientIp()
        {
            //Method inherited from \Symfony\Component\HttpFoundation\Request
            return \Illuminate\Http\Request::getClientIp();
        }

Usage Example

Example #1
0
 /**
  * Constructor.
  * @version 0.9.3
  * 
  */
 public function registerModules()
 {
     $this->translator = $this->getTranslator();
     $this->aesencoder = new AES256();
     $this->request = $this->getRequest();
     $this->userip = $this->request->getClientIp();
 }
All Usage Examples Of Request::getClientIp