Closed rjp2525 closed 5 years ago
I was able to fix within a custom service by using file_get_contents
rather than $this->client->get()
and changing $lines = explode("\n", $data[0]);
to $lines = explode("\n", $data);
:
public function update()
{
$data = file_get_contents('http://dev.maxmind.com/static/csv/codes/country_continent.csv');
// Verify server response
if ($this->client->getErrors() !== null) {
throw new Exception($this->client->getErrors());
}
$lines = explode("\n", $data);
array_shift($lines);
....
}
The download file for this is in the config file
Visiting the link used for updating the local continent data in the browser will download the
country_continent.csv
file, but runningphp artisan geoip:update
leaves an empty array withincontinents.json
in the app storage folder. Debugging and retrieving the output returns a 301 Moved Permanently response from maxmind: