Skip to content

Commit 26be325

Browse files
alberto1elpulkitjalan
authored andcommitted
Update FREEGEOIP driver to IPSTACK (#28)
* move to ipstack * default url for ipstack
1 parent fd5ddff commit 26be325

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/Drivers/FreeGeoIPDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected function getUrl($ip)
5757
if (array_get($this->config, 'secure', true)) {
5858
$protocol = 'https://';
5959
}
60-
61-
return $protocol.array_get($this->config, 'url', 'freegeoip.net').'/json/'.$ip;
60+
$key = array_get($this->config, 'key', '');
61+
return $protocol.array_get($this->config, 'url', 'api.ipstack.com').'/'.$ip.'?access_key='.$key.'&output=json&legacy=1';
6262
}
6363
}

src/config/config.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@
4343
|
4444
*/
4545
'secure' => env('GEOIP_FREEGEOIP_SECURE', true),
46+
47+
/*
48+
|--------------------------------------------------------------------------
49+
| Free IP STACK KEY
50+
|--------------------------------------------------------------------------
51+
|
52+
| IPSTACK key
53+
|
54+
*/
55+
'key' => env('GEOIP_KEY', true),
4656
],
4757

4858
/*

0 commit comments

Comments
 (0)