File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,14 @@ class TelizeDriver extends AbstractGeoIPDriver
1515 */
1616 public function get ($ ip )
1717 {
18+
1819 try {
19- $ data = json_decode ($ this ->guzzle ->get ($ this ->getUrl ($ ip ))->getBody (), true );
20+ $ data = json_decode ($ this ->guzzle ->get ($ this ->getUrl ($ ip ), [
21+ 'headers ' => [
22+ 'X-Mashape-Key ' => array_get ($ this ->config , 'key ' ),
23+ 'Accept ' => 'application/json '
24+ ]
25+ ])->getBody (), true );
2026 } catch (RequestException $ e ) {
2127 return [];
2228 }
@@ -30,8 +36,7 @@ public function get($ip)
3036 'region ' => array_get ($ data , 'region ' ),
3137 'regionCode ' => array_get ($ data , 'region_code ' ),
3238 'timezone ' => array_get ($ data , 'timezone ' ),
33- 'postalCode ' => array_get ($ data , 'postal_code ' ),
34- 'isp ' => array_get ($ data , 'isp ' ),
39+ 'postalCode ' => array_get ($ data , 'postal_code ' )
3540 ];
3641 }
3742
@@ -49,7 +54,7 @@ protected function getUrl($ip)
4954 $ protocol = 'https: ' ;
5055 }
5156
52- $ baseUrl = $ protocol .'//www. telize.com/geoip/ ' ;
57+ $ baseUrl = $ protocol .'//telize-v1.p.mashape .com/geoip/ ' ;
5358
5459 return $ baseUrl .$ ip ;
5560 }
Original file line number Diff line number Diff line change 4646 /*
4747 |--------------------------------------------------------------------------
4848 | Telize Driver
49+ | Get your API key here: https://market.mashape.com/fcambus/telize
4950 |--------------------------------------------------------------------------
5051 */
5152 'telize ' => [
53+ /*
54+ |--------------------------------------------------------------------------
55+ | Telize Service Key
56+ |--------------------------------------------------------------------------
57+ */
58+
59+ 'key ' => env ('GEOIP_TELIZE_KEY ' ),
60+
5261 /*
5362 |--------------------------------------------------------------------------
5463 | Telize Secure connection
You can’t perform that action at this time.
0 commit comments