faridbabayev/geoip
Composer 安装命令:
composer require faridbabayev/geoip
包简介
This package provides an API for the ReallyFreeFeoip
README 文档
README
This package provides an API for the ReallyFreeFeoip
Installation
You can install the package via composer:
composer require faridbabayev/geoip
Usage
use FaridBabayev\Geoip\Geoip; $geoip = new Geoip(); // this will fetch ip geolocation for server ip address $geoip = new Geoip('75.197.224.3'); // this will ip geolocation for 75.197.224.3
You can get ip geolocation by accessing
$geoip = new Geoip(); $geoip->ip; //return ip address $geoip->country_code; // return country code $geoip->country_name; // return country name $geoip->region_code; // return region code $geoip->city; // return city $geoip->zip_code; // return zip_code $geoip->time_zone; // return time zone $geoip->latitude; // return latitude $geoip->metro_code; // return metro_code
You can change ip address for a new ip geolocation by calling for() method without instantiating new class:
$geoip = new Geoip(); $geoip->for('75.197.224.3'); $geoip->country_code; // return country code
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email farid.b@code.edu.az instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-09-24