Locate and identify website visitors by IP address using IPStack API
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist daxslab/yii2-ipstack "*"
or add
"daxslab/yii2-ipstack": "*"
to the require section of your composer.json
file.
Add the component to the application:
'components' => [
'ipStack' => [
'class' => \daxslab\ipstack\Client::class,
'api_key' => '{YOUR_API_KEY}',
],
]
Request info about current user IP
Yii::$app->ipStack->getData();
Request info about a custom IP
Yii::$app->ipStack->getData($ip);