Skip to content

Commit

Permalink
Use IpInfo driver for premium using token
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Sep 7, 2019
1 parent 43ba69b commit 8933449
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 58 deletions.
12 changes: 6 additions & 6 deletions src/Drivers/IpInfo.php
Expand Up @@ -46,15 +46,15 @@ protected function hydrate(Position $position, Fluent $location)
protected function process($ip)
{
try {
$full_url = $this->url().$ip;
$url = $this->url().$ip;

if (config('location.ipinfo.token')) {
$full_url .= '?token='.config('location.ipinfo.token');
if ($token = config('location.ipinfo.token')) {
$url .= '?token='.$token;
}

$response = json_decode($this->getUrlContent($full_url));

return new Fluent($response);
return new Fluent(
json_decode($this->getUrlContent($url))
);
} catch (\Exception $e) {
return false;
}
Expand Down
52 changes: 0 additions & 52 deletions src/Drivers/IpInfoPremium.php

This file was deleted.

0 comments on commit 8933449

Please sign in to comment.