PHP code example of sicaboy / ip2country-laravel

1. Go to this page and download the library: Download sicaboy/ip2country-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sicaboy / ip2country-laravel example snippets


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

use Sicaboy\Ip2countryLaravel\Facades\Ip2country;

Ip2countryLaravel::getCountryCode('1.1.1.1');
Ip2countryLaravel::getCountryCode(request()->ip())
bash
php artisan vendor:publish --tag="ip2country-laravel-config"