protected function getUrl($ip)
    {
        // default to free service
        // free service does not support https
        $baseUrl = 'http://ip-api.com/json/';
        $key = '';

        // if key is set change to pro service
        if (array_get($this->config, 'key', false)) {
            $baseUrl = 'https://pro.ip-api.com/json/';
            $key = array_get($this->config, 'key');
        }

        return $baseUrl.$ip.(($key) ? '?key='.$key : '');
    }
protected function getUrl($ip)
    {
        // default to free service
        // free service does not support https
        $baseUrl = 'http://ip-api.com/json/';
        $key = '';

        // if key is set change to pro service
        if (array_get($this->config, 'key', false)) {
            $baseUrl = 'https://pro.ip-api.com/json/';
            $key = array_get($this->config, 'key');
        }

        return $baseUrl.$ip.(($key) ? '?key='.$key : '');
    }
protected function getUrl ( $ ip ) { // default to free service // free service does not support https $ baseUrl = 'http://ip-api.com/json/' ; $ key = '' ; // if key is set change to pro service if ( array_get ( $ this -> config , 'key' , false ) ) { $ baseUrl = 'https://pro.ip-api.com/json/' ; $ key = array_get ( $ this -> config , 'key' ) ; } return $ baseUrl . $ ip . ( ( $ key ) ? '?key=' . $ key : '' ) ; }
Get the ip-api url add key and
change base url if pro user.

@param string $ip

@return string
Get the ip - api url add key and change base url if pro user .