Validate if an ip address is public or private.
Installs: 29 564
Dependents: 0
Suggesters: 0
Security: 0
Stars: 15
Watchers: 4
Forks: 3
Open Issues: 0
Requires
- illuminate/contracts: ^5.5|^6.0|^7.0|^8.0
- symfony/http-foundation: ^3.3
Requires (Dev)
- orchestra/testbench: ^3.5|^5.0
- phpunit/phpunit: ^6.3|^9.0
README
Validates an ip address is either public or private. Supports ipv4 & ipv6.
Installation
composer require laravel-validation-rules/ip
Usage
Validate an ip address is a public address.
use LVR\IP\PublicAddress; $request->validate([ 'ip' => ['required', new PublicAddress], ]);
Validate an ip address is a private address.
use LVR\IP\PrivateAddress; $request->validate([ 'ip' => ['required', new PrivateAddress], ]);