I used the following in v8:
use Zend\Http\PhpEnvironment\RemoteAddress;
$ip = $this->app->make(RemoteAddress::class)->getIpAddress();
How do I get a user remote address now in v9?
I used the following in v8:
use Zend\Http\PhpEnvironment\RemoteAddress;
$ip = $this->app->make(RemoteAddress::class)->getIpAddress();
How do I get a user remote address now in v9?
Turned out I can simply get it from the request:
$ip = $this->request->getClientIp();
Zend Framework is removed.