Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dimsav/laravel-ip-service
A Laravel package to get the user's country using the ip. A wrapper for http://ip2nation.com
https://github.com/dimsav/laravel-ip-service
Last synced: 5 days ago
JSON representation
A Laravel package to get the user's country using the ip. A wrapper for http://ip2nation.com
- Host: GitHub
- URL: https://github.com/dimsav/laravel-ip-service
- Owner: dimsav
- License: mit
- Created: 2014-12-29T14:01:37.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-01-10T13:58:57.000Z (almost 5 years ago)
- Last Synced: 2024-08-02T08:07:55.346Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 4.88 KB
- Stars: 116
- Watchers: 7
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Laravel IP Service
====================Tries to guess the country code of the client, using his IP.
## Installation
[Download](http://ip2nation.com/ip2nation/Download) and import the ip database from [ip2nation.com](http://ip2nation.com/)
## Usage
```php
$service = App::make('Dimsav\IpService\IpService');// country code for the given ip address
echo $service->getCountryCodeFromIp('123.123.123.123');
// country code for the client's ip address
echo $service->getCountryCodeFromClientIp();
```