Cant get User Ip address
can you please create a documentation for getting users ip address
The purpose of this package is to read the UserAgent of the browser, not the request data itself.
What you are looking for is basically $request->ip() or \Request::ip().
$request->ip() or \Request::ip() returns server ip not client ip. how can i get client ip, I am using aws as hosting
request::ip is the clients IP
However, maybe you have load-balancer / reverse proxy in front and need to check https://www.google.com/search?hl=en&q=http%20x%20forwarder%20for
you can use this code to return the client ip
foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) { if (array_key_exists($key, $_SERVER) === true) { foreach (explode(',', $_SERVER[$key]) as $ip) { $ip = trim($ip); // just to be safe if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) { return $ip; } } } } return request()->ip(); // it will return server ip when no client ip found