Torann / laravel-geoip

Determine the geographical location of website visitors based on their IP addresses.
http://lyften.com/projects/laravel-geoip
BSD 2-Clause "Simplified" License
2.09k stars 372 forks source link

The GeoIP service is not valid. #100

Closed hitechqb closed 5 years ago

hitechqb commented 6 years ago

Hi all, I am using laravel 5.5. I have config on app.config for Provider and Aliases. When i call: $location = GeoIP::getLocation(); --> Bug: THe GeoIP service is not valid. (In GeoIP.php line 205)

Help me!

gopalkumar315 commented 6 years ago

use the following command link: php artisan config:clear php artisan config:cache

pdxbug commented 6 years ago

I was updating the wrong config file. Make sure to update the config file in the bootstrap/config folder, not in the vendor/torann/geoip/config folder.

13Aks13 commented 6 years ago

I have the same error for Laravel 5.5 I have config on app.config for Provider and Aliases prov -> Torann\GeoIP\GeoIPServiceProvider::class, alias-> 'GeoIP' => Torann\GeoIP\Facades\GeoIP::class,

Exception: The GeoIP service is not valid. (In GeoIP.php line 205)

Anybody have resolved this error?

bhavinjr commented 6 years ago

I had the same problem and I fixed it up. just update config/geoip.php file you can check here https://github.com/Torann/laravel-geoip/blob/master/config/geoip.php

liyu001989 commented 6 years ago

I solve this after publish config

php artisan vendor:publish --provider="Torann\GeoIP\GeoIPServiceProvider" --tag=config
bhavinjr commented 6 years ago

@liyu001989 if someone already publishes config file with the older version then it won't work and geoip.php file is updated have to update geoip.php file

summerblue commented 6 years ago

@liyu001989 Same problem, awesome fix.

acidjazz commented 6 years ago

I don't really agree on this being a "fix", shouldn't Laravel packages not require their config to be published? Wouldn't that make it a bit hard to have packages use packages?

acidjazz commented 6 years ago

submitted a PR that fixes this #119