PHPackages                             thomas-omweri/laravel-multi-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. thomas-omweri/laravel-multi-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

thomas-omweri/laravel-multi-validator
=====================================

Validates a field with multiple rules using the OR operator

v1.0.0(2y ago)54[1 PRs](https://github.com/thomasmokuaomweri2011/laravel-multi-validator/pulls)MITPHPPHP ^8.1

Since Jun 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/thomasmokuaomweri2011/laravel-multi-validator)[ Packagist](https://packagist.org/packages/thomas-omweri/laravel-multi-validator)[ Docs](https://github.com/thomas-omweri/laravel-multi-validator)[ RSS](/packages/thomas-omweri-laravel-multi-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (14)Versions (5)Used By (0)

Validates a field with multiple rules using the OR operator
===========================================================

[](#validates-a-field-with-multiple-rules-using-the-or-operator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d7d00d2008f9a622a9e7f19f923ecf7534251040d2be94df86220b6089297cc5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74686f6d61732d6f6d776572692f6c61726176656c2d6d756c74692d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/thomas-omweri/laravel-multi-validator)[![GitHub Tests Action Status](https://camo.githubusercontent.com/dc55330554369e788f10082d6ecc85dd25eb4f176b7276a300fb2ebbc3b3940c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f74686f6d61732d6f6d776572692f6c61726176656c2d6d756c74692d76616c696461746f722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/thomas-omweri/laravel-multi-validator/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/930208b82d57f8f0300a4c8329cb0cd6cad98119b1b2e426a2d1a51c3236f3d8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f74686f6d61732d6f6d776572692f6c61726176656c2d6d756c74692d76616c696461746f722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/thomas-omweri/laravel-multi-validator/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/d4d084546575a5c933eed8cc816fe4a8ce77ab8345d57838d3e7fd50d916a091/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74686f6d61732d6f6d776572692f6c61726176656c2d6d756c74692d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/thomas-omweri/laravel-multi-validator)

Sometimes you may want to validate a single field with multiple rules where at least one of the rules should be true.This was not possible until Laravel Multi Validator by Thomas Omweri happened!

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require thomas-omweri/laravel-multi-validator
```

Usage
-----

[](#usage)

```
//use LaravelMultiValidator\Rules\AnyOf;
//use LaravelMultiValidator\Rules\OrRule;

$validator = Validator::make(
    [
        'name' => 'Thomas Omweri',
        'contact' => '+2547xxxxxxxx'
    ],
    [
        'name' => [
            new orRule('starts_with:Thomas', 'ends_with:Omweri'),
        ],
        'contact' => [
            new anyOf(
                [
                    'email',
                    Rule::phone()->country('KE')->mobile(),
                    Rule::phone()->country('KE')->fixed()
                ]
            ),
        ],
    ]
);
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Thomas Omweri](https://github.com/thomasmokuaomweri2011)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1073d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d2343bef253cd79d630a78278a4f915ab8cb8bd99fb0ed11c58c41590663f5b7?d=identicon)[thomasmokuaomweri2011](/maintainers/thomasmokuaomweri2011)

---

Top Contributors

[![thomasmokuaomweri2011](https://avatars.githubusercontent.com/u/3244373?v=4)](https://github.com/thomasmokuaomweri2011 "thomasmokuaomweri2011 (14 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravellaravelvalidationphpvalidationlaravelThomas Omwerilaravel-multi-validator

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/thomas-omweri-laravel-multi-validator/health.svg)

```
[![Health](https://phpackages.com/badges/thomas-omweri-laravel-multi-validator/health.svg)](https://phpackages.com/packages/thomas-omweri-laravel-multi-validator)
```

###  Alternatives

[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k35.7M107](/packages/propaganistas-laravel-phone)[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
