2017 © Pedro Peláez
 

library laravel-ipip

ipip for laravel

image

huangdijia/laravel-ipip

ipip for laravel

  • Tuesday, July 24, 2018
  • by huangdijia
  • Repository
  • 1 Watchers
  • 9 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

laravel-ipip

Latest Stable Version Total Downloads, (*1)

Requirements

  • PHP >= 7.0
  • Laravel >= 5.5

Installation

First, install laravel 5.5, and make sure that the database connection settings are correct., (*2)

composer require huangdijia/laravel-ipip

Then run these commands to publish config, (*3)

php artisan vendor:publish --provider="Huangdijia\Ipip\IpipServiceProvider"

Configurations

// config/ipip.php
    'datx' => [
        'city'        => 'path/mydata4vipday4.datx',
        'district'    => 'path/quxian.datx',
        'basestation' => 'path/station_ip.datx',
    ],
    'auth' => [
        'mail' => '', // mail of ipip.net
        'pass' => '', // password of ipip.net
    ]

Usage

As Facade

use Huangdijia\Ipip\Facades\BaseStation;
use Huangdijia\Ipip\Facades\City;
use Huangdijia\Ipip\Facades\District;

...

BaseStation::find('66.249.69.48'); // ['美国', '美国', '', '']
City::find('66.249.69.48');
District::find('66.249.69.48');

As Command

php artisan ipip:basestation '66.249.69.48' # ['美国', '美国', '', '']
php artisan ipip:city '66.249.69.48'
php artisan ipip:district '66.249.69.48'
php artisan ipip:download # must set mail and pass at config/ipip.php

As Helper

ipip('city')->find('66.249.69.48'); // ['美国', '美国', '', '']
ipip_city()->find('66.249.69.48'); // ['美国', '美国', '', '']
ipip_city('66.249.69.48'); // ['美国', '美国', '', '']

ipip('basestation')->find('66.249.69.48');
ipip_basestation()->find('66.249.69.48');
ipip_basestation('66.249.69.48');

ipip('distric')->find('66.249.69.48');
ipip_distric()->find('66.249.69.48');
ipip_distric('66.249.69.48');

Other

  • https://www.ipip.net
  • https://github.com/ipipdotnet/datx-php

License

laravel-ipip is licensed under The MIT License (MIT)., (*4)

The Versions

20/07 2018

1.0.8

1.0.8.0 https://github.com/huangdijia/laravel-ipip

ipip for laravel

  Sources   Download

MIT

The Requires

 

by Avatar huangdijia

laravel ipip

20/07 2018

1.0.7

1.0.7.0 https://github.com/huangdijia/laravel-ipip

ipip for laravel

  Sources   Download

MIT

The Requires

 

by Avatar huangdijia

laravel ipip

20/07 2018

1.0.6

1.0.6.0 https://github.com/huangdijia/laravel-ipip

ipip for laravel

  Sources   Download

MIT

The Requires

 

by Avatar huangdijia

laravel ipip

19/07 2018

1.0.5

1.0.5.0 https://github.com/huangdijia/laravel-ipip

ipip for laravel

  Sources   Download

MIT

The Requires

 

by Avatar huangdijia

laravel ipip

19/07 2018

1.0.4

1.0.4.0 https://github.com/huangdijia/laravel-ipip

ipip for laravel

  Sources   Download

MIT

The Requires

 

by Avatar huangdijia

laravel ipip

19/07 2018

1.0.3

1.0.3.0 https://github.com/huangdijia/laravel-ipip

ipip for laravel

  Sources   Download

MIT

The Requires

 

by Avatar huangdijia

laravel ipip

19/07 2018

1.0.2

1.0.2.0 https://github.com/huangdijia/laravel-ipip

ipip for laravel

  Sources   Download

MIT

The Requires

 

by Avatar huangdijia

laravel ipip

19/07 2018

1.0.1

1.0.1.0 https://github.com/huangdijia/laravel-ipip

ipip for laravel

  Sources   Download

MIT

The Requires

 

by Avatar huangdijia

laravel ipip

19/07 2018

1.0.0

1.0.0.0 https://github.com/huangdijia/laravel-ipip

ipip for laravel

  Sources   Download

MIT

The Requires

 

by Avatar huangdijia

laravel ipip