Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Geoip Location

Geoip Location Laravel Package

victorybiz/geoip-location

View on GitHub
Deep Wiki
Context7

Get the geographical location of website visitors based on their IP addresses.

Frequently asked questions about Geoip Location
How do I install victorybiz/geoip-location in a Laravel app?
Run composer require victorybiz/geoip-location, publish the package config, and point the config at a GeoLite2 .mmdb file. No runtime credentials are needed, but MaxMind requires a free account and license key to download the database. Before committing, verify that the package's Composer constraints resolve on your Laravel version with composer why-not victorybiz/geoip-location.
Does victorybiz/geoip-location support Laravel 9, 10, or 11?
The last release was 2021-12-29, which predates Laravel 9, so its illuminate/support constraints may block installation on newer versions or install with untested behavior. Test it on your exact Laravel and PHP versions before adopting it. If it does not resolve cleanly, plan to fork it or use the underlying geoip2/geoip2 reader directly behind your own interface.
Do I need a MaxMind license key or API credentials to use this package?
There are no runtime credentials or API keys because lookups are local file reads against a MaxMind .mmdb database. However, MaxMind requires a free account and license key to download GeoLite2 data, which is an operational dependency rather than a code dependency. This local-only design means no egress, no per-lookup cost, and IP data never leaves your infrastructure.
Where do I put the GeoLite2-City.mmdb file and how is it configured?
The package publishes a config/geoip.php file, and you place the GeoLite2 .mmdb file at the path configured there. A missing, corrupt, or unreadable database is your responsibility to handle, so define whether lookups fail open to a default locale or fail closed. Because the package ships no integrity check, validate the file as part of deployment or refresh jobs.
How do I get a visitor's country, city, or timezone with this package?
It registers a GeoIP facade and a geoip() helper that expose country, country code, continent, state or region, city, postal code, latitude and longitude, timezone, and currency. Call sites typically look like GeoIP::getCountry() inside middleware or controllers. To avoid coupling business logic directly to the package, wrap these calls in your own small geolocation service.
How do I keep the GeoLite2 database up to date with victorybiz/geoip-location?
The package provides no updater, scheduler, or integrity check, so database lifecycle is entirely manual. You need to own the MaxMind license key, a scheduled download or refresh job, validation, and deployment of the new .mmdb file. Country-level accuracy decays measurably within months as IP blocks are reallocated, and city-level accuracy decays faster.
Is victorybiz/geoip-location accurate enough for city-level geolocation?
GeoLite2 city data is inherently approximate and directional rather than precise, so it should never be presented as authoritative for fraud checks or legal jurisdiction decisions. Country-level results are usually adequate for redirects, locale selection, and currency display. If you need reliable city or timezone precision, evaluate whether paid GeoIP2 data is justified before relying on GeoLite2.
How does the package handle private IPs, IPv6, or requests behind a CDN or load balancer?
Edge cases such as private or reserved IPs, IPv6, and CDN or load-balancer X-Forwarded-For resolution are yours to handle, not the package's. Behind a proxy, Laravel's trusted-proxy configuration must already be correct so request()->ip() returns a meaningful address. Decide on fallback behavior for unresolvable IPs, typically failing open to a default locale or currency.
What are the licensing and GDPR or CCPA considerations for this package?
GeoLite2 is licensed under CC BY-SA 4.0, so attribution is required in your product, usually on a privacy or legal page. IP addresses plus geolocation are personal data under GDPR and CCPA; local processing is a strong story versus API vendors because there is no processor or cross-border transfer, but you still need a lawful basis, retention rules, and disclosure. Have legal review the attribution and privacy notice before launch.
Is victorybiz/geoip-location maintained, and what are the alternatives?
With a last release in 2021, around 21 stars, a single maintainer, and no visible release cadence, treat it as unmaintained. Practical alternatives are forking the package, consuming geoip2/geoip2 directly behind your own interface, or moving to a maintained geo service if operational simplicity matters more than local processing. Whichever you choose, confirm the Laravel support matrix and who owns database refreshes and attribution.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console