Skip to content

Validate if an ip address is public or private.

License

Notifications You must be signed in to change notification settings

anio/ip

 
 

Repository files navigation

IP

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],
]);

About

Validate if an ip address is public or private.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%