Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location testing has no effect #166

Open
dutypro opened this issue Apr 30, 2024 · 1 comment
Open

Location testing has no effect #166

dutypro opened this issue Apr 30, 2024 · 1 comment

Comments

@dutypro
Copy link

dutypro commented Apr 30, 2024

Bug

I'm trying to make use of the LOCATION_TESTING boolean in my env file to set an IP address manually whilst on localhost but it doesn't have any effect.

.env:

LOCATION_TESTING=true

location.php config (I swapped around the enabled and ip keys to test with no joy):

'testing' => [
        'enabled' => env('LOCATION_TESTING', true),
        'ip' => '66.102.0.0',
    ],

I get this error message in the logs:

local.ERROR: The address 127.0.0.1 is not in the database. {"userId":1,"exception":"[object] (GeoIp2\\Exception\\AddressNotFoundException(code: 0): The address 127.0.0.1 is not in the database.

What I've Tried

  • Clearing the config cache,
  • Setting it to false and then back to true again,
  • Running it via php artisan serve (I use valet, mysite.test)
  • Changing IP addresses,
  • Changing the order of the testing array of keys in the config file.

Any help is appreciated!

@stevebauman
Copy link
Owner

Hi @dutypro!

Can you remove the env() method all-together to ensure your .env file is not taken into account for debugging? Ex:

'testing' => [
-   'enabled' => env('LOCATION_TESTING', true),
+   'enabled' => true,
    'ip' => '66.102.0.0',
],

Update to the above, then try retrieving the location again to see if the issue is resolved and let me know 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants