stevebauman / location

Detect a users location by their IP Address.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't run php artisan location:update

jobasco opened this issue · comments

Hi, just downloaded the package but i can't run php artisan location:update
i am getting.

ErrorException

fopen(https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=xUvjUr&suffix&suffix=tar.gz): Failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request

Same. The documentation doesnt include this, but you need to change the drive in location.php after publish to


    'driver' => Stevebauman\Location\Drivers\MaxMind::class,

Hi @jobasc0,

Did you alter the download URL in your published config/location.php file? suffix exists twice in the URL you provided in the exception message. Visiting the URL provides an invalid suffix error, then fixing that provides an invalid license key error.

'local' => [
'type' => 'city',
'path' => database_path('maxmind/GeoLite2-City.mmdb'),
'url' => sprintf('https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=%s&suffix=tar.gz', env('MAXMIND_LICENSE_KEY')),
],

Please try deleting, then re-publishing the config file, then re-run location:update.