Download the PHP package mallardduck/extended-validator-laravel without Composer
On this page you can find all versions of the php package mallardduck/extended-validator-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package extended-validator-laravel
Extended Validation for Laravel
An extension to Laravel's Validator class that provides some additional validation rules.
Installation
You can install the package via composer:
Just require the project and Laravel's Service Provider Auto-discovery will do the rest.
All the new rules will be automatically registered for use without any configuration.
Requirements
- PHP 8.x
- Laravel 8.32.x (or greater)
Past PHP version support
PHP | Package |
---|---|
8.0 | Current |
7.4 | 2.3.1 |
Available Rules
PublicIp
PublicIpv4
NonPublicIpv4
NotInIf
NotInIfValue
PublicIpv6
ProhibitedIf
ProhibitedWith
ProhibitedWithAll
PublicIp
Determine if the field under validation is a valid public IP address.
Just like Laravel's ip
rule, but IPs cannot be within private or reserved ranges.
PublicIpv4
Determine if the field under validation is a valid public IPv4 address.
Just like Laravel's ipv4
rule, but IPs cannot be within private or reserved ranges.
NonPublicIpv4
Determine if the field under validation is a valid non-public IPv4 address.
Just like Laravel's ipv4
rule, but IPs should only be within private or reserved ranges.
NotInIf
not_in_if:anotherfield,value,...
The field under validation must not be included in the given list of values only when the given fieled is truthy.
Think of this as a conditional version of not_in
rule.
NotInIfValue
not_in_if_value:anotherfield,anotherfield_value,value,...
The field under validation must not be included in the given list of values only when the value of the anotherfield
field is equal to anotherfield_value
.
Think of this as a conditional version of not_in
rule.
PublicIpv6
Determine if the field under validation is a valid public IPv6 address.
Just like Laravel's ipv6
rule, but IPs cannot be within private or reserved ranges.
ProhibitedIf
It's now suggested that you use the native Laravel version of this rule. This package now requires the version that ships this, so it should be there.
For more info see the docs: https://laravel.com/docs/8.x/validation#rule-prohibited-if
Probhits
aka ProhibitedWith
It's now suggested that you use the native Laravel version of this rule, even though it's slightly different. This package will require that version moving forward so the rule will be there.
For more info, see: https://laravel.com/docs/9.x/validation#rule-prohibits
ProhibitedWithAll
Use of the field under validation is prohibited only if all the other specified fields are present.
Think of it as the opposite of Laravel's required_with_all
.
Testing
Note: The tests are great examples of potential uses for these rules.
License
The MIT License (MIT). Please see License File for more information.