Weave Code
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
Maxmind Binary Provider

Maxmind Binary Provider Laravel Package

geocoder-php/maxmind-binary-provider

MaxMind Binary provider for the PHP Geocoder library. Lookup geolocation data from local MaxMind GeoIP2/GeoLite2 binary databases without external API calls. Useful for fast, offline IP-to-location resolution in PHP apps.

View on GitHub
Deep Wiki
Context7

[READ ONLY] Provider for MaxMind Binary

Frequently asked questions about Maxmind Binary Provider
How do I install the MaxMindBinaryProvider in a Laravel project?
Run `composer require geocoder-php/geocoder geocoder-php/maxmind-binary-provider` to install the package. Then, register the provider in your Laravel app by calling `$geocoder->registerProvider('maxmind', new BinaryProvider('/path/to/database.mmdb'))` after initializing the Geocoder instance.
What Laravel versions does this package support?
The package works with Laravel 8+ (PHP 8.0+) since it depends on Geocoder v4+, which enforces these requirements. Ensure your project meets these PHP and Laravel version constraints.
Can I use this for real-time fraud detection in Laravel?
Yes, the provider is optimized for fast lookups (sub-millisecond for local files). For high-throughput systems, cache results in Redis or another store to reduce database read frequency during peak traffic.
Do I need a MaxMind API key for this package?
No, this provider uses locally stored MaxMind binary databases (e.g., GeoLite2 or GeoIP2 .mmdb files), so no API key or external calls are required. You only need to purchase/download the database separately.
How do I configure the database path in Laravel?
Store the path to your `.mmdb` file in Laravel’s config (e.g., `config/services.php`). Example: `'geocoder_maxmind_path' => storage_path('app/GeoLite2-City.mmdb')`. Then reference it in your provider initialization.
What’s the difference between GeoLite2 and GeoIP2 for this provider?
GeoLite2 is MaxMind’s free tier with lower accuracy, while GeoIP2 is a paid, higher-precision database. Both work with this provider, but GeoIP2 is better for production apps requiring granularity (e.g., city-level fraud detection).
Can I use this provider in Laravel queues for batch geocoding?
Yes, the provider is stateless and can be safely used in Laravel queues. Load the `.mmdb` file once per queue worker or cache it in memory to avoid repeated file I/O during batch processing.
How do I handle database updates in a production Laravel app?
Automate updates by downloading new `.mmdb` files via a cron job or Laravel scheduler. Store the file in a versioned directory (e.g., `storage/app/geodb/v1/`) and update your config path dynamically if needed.
What alternatives exist for IP geolocation in Laravel?
Alternatives include the `geocoder-php/google-maps-provider` (API-based, slower but global), `ip2location/ip2location-php` (self-hosted but less maintained), or `spatie/laravel-geocoder` (a Laravel wrapper for Geocoder). Choose based on offline needs vs. API flexibility.
How do I test this provider in Laravel’s testing environment?
Mock the `BinaryProvider` in unit tests by injecting a fake `.mmdb` file or using Geocoder’s built-in test doubles. For integration tests, use MaxMind’s free test database (e.g., `GeoLite2-City-Test.mmdb`) and verify responses match expected locations.
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky