Download the PHP package xbnz/laravel-multi-ip without Composer
On this page you can find all versions of the php package xbnz/laravel-multi-ip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xbnz/laravel-multi-ip
More information about xbnz/laravel-multi-ip
Files in xbnz/laravel-multi-ip
Package laravel-multi-ip
Short Description Asynchronous API wrapper with proxy and multiple key support for Laravel
License MIT
Informations about the package laravel-multi-ip
Laravel Multi API
Supported APIs
Provider | Key required | Normalized Object |
---|---|---|
Abstractapi.com | ✅ | NormalizedGeolocationResultsData::class |
Abuseipdb.com | ✅ | NormalizedGeolocationResultsData::class |
Ipapi.co | ❌ | NormalizedGeolocationResultsData::class |
Ipapi.com | ✅ | NormalizedGeolocationResultsData::class |
Ip-api.com | ❌ | NormalizedGeolocationResultsData::class |
Ipdata.co | ✅ | NormalizedGeolocationResultsData::class |
Ipgeolocation.io | ✅ | NormalizedGeolocationResultsData::class |
Ipinfo.io | ✅ | NormalizedGeolocationResultsData::class |
Mtr.sh: ping | ❌ | MtrDotShPingResultsData::class |
Mtr.sh: mtr | ❌ | MtrDotShMtrResultsData::class |
Installation
Ensure that your composer.json file tells Laravel to auto-wire package service providers to your project:
The config files
- Publish config files:
Support for multiple API keys
You may configure each driver in the config files with multiple API keys. API keys will be chosen randomly per HTTP request. If you have elected to use retry functionality, the key will be rehydrated on every try.
Caching
Caching is enforced by default as the alternative with exhaust your rate limiting very quickly. If you are using a time-sensitive service, use Laravel's Config facade to reduce caching before your API call.
Proxies
HTTP, HTTPS, SOCKS supported. Please use the URL structure denoted above. If you have elected to use retry functionality, the proxy will be rehydrated on every try.
API downtime can disrupt your app. Plan ahead.
Geolocation
The minimum normalized response you can expect from each IP API. Note there may be null values, refer to NormalizedGeolocationResultsData::class for structure.
- IP address quried
- Country
- City
- Latitude
- Longitude
- Organization/ISP
Combining all of your APIs
You can receive complete information for an IP using all of your APIs to put together a comprehensive report. Increase your async value in the resolver.php
config file to expedite the process if you have many IPs and drivers.
Raw API output
If you do not wish to receive condensed, normalized information, you may use the raw method:
ℹ️ This works in the same way as normalize(). Keep in mind there is no guarantee of data integrity with this option, the result is returned directly from the API in most cases. |
---|
Alternative to chaining
Downtime monitoring with the MTR.sh API
MTR.sh is a Looking Glass API that gives you access to hundreds of networks around the world. This is particularly useful for downtime monitoring. The problem with the MTR.sh API is that the result is not friendly for programming languages. This is no longer the case for Laravel developers.
MTR.sh search term examples:
Choose what MTR.sh networks you would like to use
Search type | Search term |
---|---|
Country | ['Germany', 'Brazil', 'Canada'] |
City | ['Frankfurt', 'Rio', 'Toronto'] |
Continent | ['Europe', 'South America', 'North America'] |
UN/LOCODE | ['defra', 'brrio', 'cator'] |
ISP | ['G-Core Labs', 'Anexia', 'Google'] |
For a complete list, visit https://mtr.sh/probes.json
ℹ️ Some MTR.sh probes may not support IPv6, or may not have some abilities, such as the ability to perform MTR tests. When you specify a search term, if no probes match the IP or test type capability, MtrProbeNotFoundException::class will be thrown |
---|
A quick word on the design
If you would like to extend the package to support other APIs, please keep the following in mind:
-
One driver per endpoint -- GET: https://someapi.io/geo/1.1.1.1: SomeApiGeoDriver::class -- POST: https://someapi.io/geo/bulk: SomeApiGeoBulkDriver::class
AuthStrategies
&RetryStrategies
are responsible for applying api key headers, paths and query params, not the driver.-
Normalize()
functionality will only work if there is aMapper::class
thatsupports()
the targetDriver::class
- Mappers, Drivers, and Strategies are all registered in the
ResolverServiceProvider::class
&IpServiceProvider::class
- New API categories like currency conversion API drivers will follow the same pattern: registered in a theoretical
CurrencyServiceProvider::class
Contributing
Pull requests and issues are welcome.
License
MIT
All versions of laravel-multi-ip with dependencies
ext-intl Version *
caseyamcl/guzzle_retry_middleware Version ^2.7
kevinrob/guzzle-cache-middleware Version ^4.0
illuminate/config Version ^9.0
illuminate/cache Version ^9.0
illuminate/collections Version ^9.0
illuminate/http Version ^9.0
illuminate/support Version ^9.0