PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Gabriel Alejandro López López   Yii2 IPStack   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Yii2 IPStack
Find the location of a computer with an IP address
Author: By
Last change:
Date: 1 month ago
Size: 810 bytes
 

Contents

Class file image Download

Yii2 IPStack Client

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);