daxslab/yii2-ipstack

Locate and identify website visitors by IP address

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Open Issues: 0

Type:yii2-extension

v1.0 2021-08-22 23:15 UTC

This package is auto-updated.

Last update: 2024-12-23 06:38:13 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);