daxslab / yii2-ipstack
Locate and identify website visitors by IP address
v1.0
2021-08-22 23:15 UTC
Requires
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2026-02-23 09:17:45 UTC
README
Locate and identify website visitors by IP address using IPStack API
Installation
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.
Configuration
Add the component to the application:
'components' => [ 'ipStack' => [ 'class' => \daxslab\ipstack\Client::class, 'api_key' => '{YOUR_API_KEY}', ], ]
Usage
Request info about current user IP
Yii::$app->ipStack->getData();
Request info about a custom IP
Yii::$app->ipStack->getData($ip);