diff --git a/src/Api/Services/IPApi.php b/src/Api/Services/IPApi.php index a78f2c3..75458f5 100644 --- a/src/Api/Services/IPApi.php +++ b/src/Api/Services/IPApi.php @@ -84,7 +84,7 @@ protected function getRequestOptions(?string $apiKey, array $ips = null): array $options['query'] = [ 'fields' => $this->requestFields, ]; - + if ($ips && is_array($ips)) { // array is key => value, we only want values, then encode to json $ips = array_values($ips); diff --git a/src/Api/Services/IPApiPro.php b/src/Api/Services/IPApiPro.php index 7e503cb..27f45fa 100644 --- a/src/Api/Services/IPApiPro.php +++ b/src/Api/Services/IPApiPro.php @@ -39,7 +39,7 @@ protected function getRequestOptions(?string $apiKey, array $ips = null): array { $options = parent::getRequestOptions($apiKey, $ips); $options['query']['key'] = $apiKey; - + return $options; } } diff --git a/src/Command/FetchIPInfoHandler.php b/src/Command/FetchIPInfoHandler.php index b4ff7e6..25c7903 100644 --- a/src/Command/FetchIPInfoHandler.php +++ b/src/Command/FetchIPInfoHandler.php @@ -14,9 +14,7 @@ use FoF\GeoIP\Api\GeoIP; use FoF\GeoIP\Model\IPInfo; use FoF\GeoIP\Repositories\GeoIPRepository; -use Illuminate\Database\Eloquent\ModelNotFoundException; use Psr\Log\LoggerInterface; -use RuntimeException; class FetchIPInfoHandler { diff --git a/src/Listeners/RetrieveIP.php b/src/Listeners/RetrieveIP.php index 96a4242..f864add 100644 --- a/src/Listeners/RetrieveIP.php +++ b/src/Listeners/RetrieveIP.php @@ -1,5 +1,14 @@ queue = $queue; $this->geo = $geo; } - + public function subscribe(Dispatcher $events) { $events->listen(PostSaving::class, [$this, 'handlePost']);