PHP code example of subarist / waterhole-geoip

1. Go to this page and download the library: Download subarist/waterhole-geoip 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/ */

    

subarist / waterhole-geoip example snippets


FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE

return [
    'provider' => env(
        'GEOIP_PROVIDER',
        env('IPINFO_TOKEN') ? 'ipinfo' : 'ip-api',
    ),

    'ip-api' => [
        'url' => 'http://ip-api.com/json',
    ],

    'ipinfo' => [
        'token' => env('IPINFO_TOKEN'),
    ],
];
bash
php artisan migrate
bash
php artisan optimize:clear
bash
php artisan octane:reload
bash
php artisan optimize:clear
bash
php artisan octane:reload
text
ip_address
country_code
text
config/waterhole-geoip.php