track_ip/demo

This package is abandoned and no longer maintained. No replacement package was suggested.

Demo package for tracking and geocoding ip addresses.

dev-master 2018-08-31 05:47 UTC

This package is not auto-updated.

Last update: 2022-02-01 13:14:31 UTC


README

Usage Instruction for package GeoCoding Ip addresses.

  1. For using this package you have to register in the IpInfoDb site and get your free API Key for geocoding IP addresses..

    URL for registering: https://www.ipinfodb.com/register

  2. Include class on top using following line.

use track_ip\Demo\Demo;

  1. In composer.json include following line

"require": { "track_ip/Demo": "dev-master" }

  1. Execute the command

composer update

  1. Add following line to providers array in app.php

track_ip\Demo\DemoServiceProvider::class

  1. Add following line to aliases array

'track_ip' => track_ip\Demo\Demo::class

  1. Use following code in your controller

$ip = $_SERVER['REMOTE_ADDR']; $geo = new Demo(); $format = "json"; // can be raw, xml or json $geovalues = $geo->getGeoLocation($ip, "YOUR IPINFODB API KEY", $format);

  1. Results

statusCode: 100 statusMessage: Error: Invalid Number Of Arguments Passed

statusCode: 101 statusMessage: Invalid Result Format Requested

statusCode: 102 statusMessage: Invalid Ip Format

statusCode: OK statusMessage: IP Geocoded Successfully