Looking to hire Laravel developers? Try LaraJobs

ip2country-laravel maintained by sicaboy

Description
Laravel Client for ip2country
Author
Last update
2023/04/13 15:12 (dev-main)
License
Downloads
9

Comments
comments powered by Disqus

Laravel Client for ip2country

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Laravel Client for ip2country

Installation

You can install the package via composer:

composer require sicaboy/ip2country-laravel

You can publish the config file with:

php artisan vendor:publish --tag="ip2country-laravel-config"

This is the contents of the published config file:

return [
    'api_key' => env('IP2COUNTRY_API_KEY'),
    'api_url' => env('IP2COUNTRY_API_URL', 'https://ip2country.yourdomain.com'),
];

Usage

use Sicaboy\Ip2countryLaravel\Facades\Ip2country;

Ip2countryLaravel::getCountryCode('1.1.1.1');
Ip2countryLaravel::getCountryCode(request()->ip())

You will get the country code of the IP address.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.