Download the PHP package michaelcrowcroft/laravel-cloud-ip without Composer
On this page you can find all versions of the php package michaelcrowcroft/laravel-cloud-ip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download michaelcrowcroft/laravel-cloud-ip
More information about michaelcrowcroft/laravel-cloud-ip
Files in michaelcrowcroft/laravel-cloud-ip
Package laravel-cloud-ip
Short Description Track the IP ranges in use by cloud providers and determine if IP addresses are associated with them. Compatable with both IPv4 and IPv6.
License MIT
Informations about the package laravel-cloud-ip
☁️ Track Cloud Provider IPs
Track IP ranges in use by cloud providers and determine if IP addresses are associated with them. Compatable with both IPv4 and IPv6.
Cloud providers currently supported:
- Amazon Web Services
- Google Cloud Platform
Coming Soon:
- Azure
- Cloudflare
Installation
You can install the package via composer:
The package will automatically register itself.
While the package doesn't publish a migration file, you do need to run its migrations before using.
Now that you have migrated the cloud_ip
table you can use the provided artisan command to populate the table with cloud provider's published IP ranges.
Usage
Once the package is installed you can access information about the IP addresses cloud providers are using through CloudIP
model. A list of th fields associated are below. This can be used like any other eloquent model.
A method is provided to select a record associated with an IP. We only select the first record, because one IP might be in multiple ranges that cloud providers use for difference services. Ultimately they will all come back to the same cloud provider though. This accepts an IP address as a long, hex, or in dot notation (as a string).
This can be used as follows, returning the single CloudIP record that the IP is associated with if it is in fact associated with a cloud provider.
Provided Fields
- ip_prefix: A range of IPs in CIDR notation.
- first_ip: The first IP in the range as a long.
- last_ip: The last IP in the range as a long.
- type: Whether an IP range is IPv4 or IPv6.
- provider: The cloud provider the IP range is associated with.
Extra Tip
Cloud providers don't often change their IP addresses in use, but it can be worth setting up provided artisan command to run weekly in the scheduler to make sure your Cloud IP data is up to date.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-cloud-ip with dependencies
laravel/framework Version ^10.0
symfony/http-foundation Version ^6.0.0
guzzlehttp/guzzle Version ^7.2
s1lentium/iptools Version ^1.2