Closed mendrinos closed 8 years ago
Sounds like you need to update your config file. I bet the services are missing in yours.
I'm also adding a check so that the Application instance won't be sent as the service.
Look over the upgrade guide http://lyften.com/projects/laravel-geoip/doc/upgrade.html
Same error for me.
I am getting the following: php artisan geoip:update [Exception] The GeoIP service is not valid.
Here is my config/geoip.php `<?php
return array(
/*
|--------------------------------------------------------------------------
| Service
|--------------------------------------------------------------------------
|
| Current only supports 'maxmind'.
|
*/
'service' => 'maxmind',
/*
|--------------------------------------------------------------------------
| Services settings
|--------------------------------------------------------------------------
|
| Service specific settings.
|
*/
'maxmind' => array(
'type' => env('GEOIP_DRIVER', 'database'), // database or web_service
'user_id' => env('GEOIP_USER_ID'),
'license_key' => env('GEOIP_LICENSE_KEY'),
'database_path' => storage_path('app\geoip.mmdb'),
'update_url' => 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz',
),
/*
|--------------------------------------------------------------------------
| Default Location
|--------------------------------------------------------------------------
|
| Return when a location is not found.
|
*/
'default_location' => array (
"ip" => "127.0.0.0",
"isoCode" => "US",
"country" => "United States",
"city" => "New Haven",
"state" => "CT",
"postal_code" => "06510",
"lat" => 41.31,
"lon" => -72.92,
"timezone" => "America/New_York",
"continent" => "NA",
),
);`
My composer.json
"torann/geoip": "^1.0", "geoip2/geoip2": "~2.1"
config/app providers
\Torann\GeoIP\GeoIPServiceProvider::class,
config/app aliases
'GeoIP' => \Torann\GeoIP\Facades\GeoIP::class,
You are using an old v0.2 config file. You need to upgrade it https://github.com/Torann/laravel-geoip/blob/master/config/geoip.php
Thanks. Works fine.
Great to hear! 🎆
Thanks @Torann! all good from my side as well.
Hello,
I am getting the following:
php artisan geoip:update The current service "Illuminate\Foundation\Application" does not support updating.
Also, whenever I use the geoip helper I am getting:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Call to undefined method Illuminate\Foundation\Application::hydrate()
Any idea?