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
Ip Geo Base

Ip Geo Base Laravel Package

cimus/ip-geo-base

Определение страны, города, региона и координат по IP через базы ipgeobase.ru. Загружает архив, конвертирует текстовые базы в бинарный формат для быстрого поиска. Обновление данных удобно запускать по cron (например, раз в неделю).

View on GitHub
Deep Wiki
Context7

Данный модуль предназначен для определения геграфических данных по IP адресу

Frequently asked questions about Ip Geo Base
How do I install cimus/ip-geo-base in Laravel?
Run `composer require cimus/ip-geo-base` or add it to your `composer.json` under `require`. The package integrates seamlessly with Laravel’s autoloader for versions 5.5+.
What Laravel versions does this package support?
The package works with Laravel 8.x, 9.x, and 10.x. For older versions (5.5+), manually register the service provider if autoloading fails.
How do I initialize the IP geolocation database?
Use `IpGeoBaseUtil` to load and convert the archive: `$util->loadArchive($path); $util->convertInBinary($path);`. Store the binary DB in a `DB/` directory.
Can I use this package with MySQL or PostgreSQL instead of SQLite?
Yes, but SQLite is default for simplicity. For production, migrate to MySQL/PostgreSQL and add indexes on `ip_from`/`ip_to` columns for faster range queries.
How often should I update the IP geolocation data?
Schedule weekly cron jobs to update via `php artisan ipgeobase:update`. Daily updates are recommended for high accuracy, but adjust based on your use case.
What performance should I expect without caching?
SQLite queries typically return in **<50ms** for single lookups. For high traffic (e.g., 10K+ QPS), implement Redis caching to reduce latency to **<10ms**.
Does this package support IPv6 addresses?
Limited support in the base package. For full IPv6, you may need to extend the `IpGeoBase` class or use a fork with custom IPv6 range handling.
How can I integrate this into Laravel middleware?
Create middleware to attach geo data to requests: `Request::ipGeo()` or use a facade like `Geo::country($ip)`. Example: `app/Http/Middleware/GeoData.php`.
What are the licensing costs for ipgeobase.ru data?
Check ipgeobase.ru’s licensing terms—some databases require commercial licenses for production. Free tiers may suffice for testing or low-traffic apps.
Are there alternatives to this package for Laravel?
Consider cloud APIs like AWS Location Service or MaxMind GeoIP2 for managed solutions. For self-hosted, compare with `spatie/geoip` (IP2Location) or `rubix/ml-geoip` (machine learning).
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.
boundwize/jsonrecast
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata