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 Info Provider

Ip Info Provider Laravel Package

geocoder-php/ip-info-provider

IP-Info provider for the Geocoder PHP library. Looks up IP addresses using the ipinfo.io service and returns structured location data (country, region, city, coordinates, timezone, etc.) via a simple provider adapter.

View on GitHub
Deep Wiki
Context7

[READ ONLY] Provider for IpInfo

Frequently asked questions about Ip Info Provider
How do I install the ipinfo.io provider for Laravel geocoding?
First, install the Geocoder library via Composer: `composer require geocoder-php/geocoder`. Then add the ipinfo.io provider: `composer require geocoder-php/ip-info-provider`. Configure it in your `config/geocoder.php` with your ipinfo.io token and preferred cache driver.
What Laravel versions does this package support?
The package works with Laravel 8.x, 9.x, and 10.x, as it relies on PHP 8.1+ and the Geocoder library, which maintains compatibility with modern Laravel releases. Check the Geocoder package’s docs for exact PHP version requirements.
Can I use this provider without Laravel?
Yes, this package is framework-agnostic. It integrates with the Geocoder library, which can be used in any PHP 8.1+ application. Laravel-specific features (like `.env` token storage) are optional and can be adapted to other environments.
How do I cache responses to avoid hitting ipinfo.io’s rate limits?
Configure a cache adapter in your Geocoder config (e.g., Redis or Memcached) by setting the `cache` key to `'redis'` or your preferred driver. The package supports Geocoder’s built-in caching layer, reducing API calls significantly.
What data fields does this provider return for an IP address?
The provider returns structured location data including city, region, country, latitude/longitude coordinates, and timezone (when available). For full field details, refer to the [ipinfo.io API documentation](https://ipinfo.io/developers).
How do I handle API failures or rate limits in production?
Use Geocoder’s `ProviderChain` to define fallback providers (e.g., GeoIp2 or another ipinfo.io-compatible service). Configure retries in your HTTP client (e.g., Guzzle) and monitor usage to stay within ipinfo.io’s free tier limits (1,000 requests/month).
Is there a free tier for ipinfo.io, and how does it affect my Laravel app?
Yes, ipinfo.io offers a free tier with 1,000 requests/month. For Laravel apps, this is sufficient for low-to-moderate traffic. For higher volumes, upgrade to a paid plan ($99+/month) or implement aggressive caching to minimize API calls.
Can I use this provider for real-time fraud detection in Laravel?
Yes, but latency (~100–300ms per request) may impact performance. Mitigate this by caching responses or processing geocoding asynchronously (e.g., via Laravel Queues). For critical paths, consider a local database like MaxMind GeoIP2 for sub-10ms lookups.
How do I switch from ipinfo.io to another provider (e.g., Google Maps or MaxMind)?
The package adheres to Geocoder’s Provider interfaces, so swapping is straightforward. Remove the `IpInfoProvider` from your config and add the new provider (e.g., `GoogleMapsProvider` or `GeoIp2Provider`). No code changes are needed beyond configuration.
Does this package support GDPR/CCPA compliance for IP-based geolocation?
The package itself doesn’t handle compliance, but you can anonymize or pseudonymize IP-derived data before logging or processing. Use ipinfo.io’s data responsibly—avoid storing raw IP addresses and consider offering users the ability to opt out of geolocation tracking.
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.
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
spatie/mailcoach-vapor