protected function updateMaxmindDatabase()
    {
        $maxmindDatabaseUrl = array_get($this->config, 'maxmind.download', 'http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz');

        $database = array_get($this->config, 'maxmind.database', false);

        if (! file_exists($dir = pathinfo($database, PATHINFO_DIRNAME))) {
            mkdir($dir, 0777, true);
        }

        try {
            $file = $this->guzzle->get($maxmindDatabaseUrl)->getBody();

            file_put_contents($database, gzdecode($file));
        } catch (Exception $e) {
            return false;
        }

        return $database;
    }