stevebauman / location

Detect a users location by their IP Address.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IP Pro driver doesn't return currency

robdekort opened this issue · comments

Thank you for this awesome package. For a commercial client I just switched to IP API Pro. However, it seems this driver doesn't return all fields. For example: the currency field is null by default when using

When I update IpApiPro.php driver to the following, the expected fields are returned:

<?php

namespace Stevebauman\Location\Drivers;

class IpApiPro extends IpApi
{
    /**
     * {@inheritDoc}
     */
    public function url(string $ip): string
    {
        $key = config('location.ip_api.token');

        return "https://pro.ip-api.com/json/$ip?key=$key&fields=status,message,country,countryCode,region,regionName,city,zip,lat,lon,timezone,currency,isp,org,as,query";
    }
}

Do you welcome a PR for this?

Hi @robdekort,

Thanks for your kind words! Yes absolutely -- send a PR and I can have it merged and released 🙏

Oh love it, thanks, just submitted a PR that should fix this.