PHPackages                             revenuewire/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. revenuewire/validator

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

revenuewire/validator
=====================

RW Helpers

v1.1.14(5y ago)01.6k↓42.9%[1 PRs](https://github.com/revenuewire/validator/pulls)Apache-2.0PHPCI passing

Since Oct 18Pushed 3mo ago7 watchersCompare

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

READMEChangelog (10)Dependencies (1)Versions (19)Used By (0)

[![Build Status](https://camo.githubusercontent.com/3eb495f4aeb1b6a31594efde89f9a0461bc5c6a0ae8db9f7df7318e3c90b025f/68747470733a2f2f7472617669732d63692e6f72672f726576656e7565776972652f76616c696461746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/revenuewire/validator)[![Coverage Status](https://camo.githubusercontent.com/9134989d31354a6c8ca658eb9c155595babc9c26ce411a80ba19760d9a11ee40/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f726576656e7565776972652f76616c696461746f722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/revenuewire/validator?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/2dc6e92f212c359d7bbb898970a1561731aa76f2f5bc7d1a8f92f9d0098cd909/68747470733a2f2f706f7365722e707567782e6f72672f726576656e7565776972652f76616c696461746f722f762f737461626c65)](https://packagist.org/packages/revenuewire/validator)[![License](https://camo.githubusercontent.com/28ed484907449f9227dc143e79d4daf59cae0110b2d8820ca14a1ded9652b10f/68747470733a2f2f706f7365722e707567782e6f72672f726576656e7565776972652f76616c696461746f722f6c6963656e7365)](https://packagist.org/packages/revenuewire/validator)[![composer.lock](https://camo.githubusercontent.com/d1c0431d1d95add4feb99c816f3714938ea70236083cc056c1a0c84234ce389e/68747470733a2f2f706f7365722e707567782e6f72672f726576656e7565776972652f76616c696461746f722f636f6d706f7365726c6f636b)](https://packagist.org/packages/revenuewire/validator)

Quick Start
===========

[](#quick-start)

Install
-------

[](#install)

```
composer require revenuewire/validator
```

Usages
------

[](#usages)

### Simple Example

[](#simple-example)

```
//example of testing my age
$validator = new \RW\Validator();
$result = $validator->validateAge(20, "myAge", ["min" => 18, "max" => 99]);
var_dump($result); //true

//same validator, but using birthday
$validator = new \RW\Validator();
$result = $validator->validateAge("1987-01-08", "myAge", ["min" => 18, "max" => 99]);
var_dump($result); //true

$validator = new \RW\Validator();
$result = $validator->validateAge(16, "myAge", ["min" => 18, "max" => 99]);
var_dump($result); //false

/**
*  [
*     "key" => "myAge",
*     "error" => "myAge must be greater than 18.",
*     "contexts" => [
*        "min" => 18, "max" => 99
*     ]
*  ]
*/
var_dump($validator->getValidateResult());
```

Options
-------

[](#options)

OptionsCommentsmaxIf it is string validation, use strlen().minIf it is string validation, use strlen().allowedValuesAn array of items allowed for a given datavalidExceptionsAn array of characters that always consider valid regardless the type check. For examples, if the validException is set to be \["\_", "-"\], and combine with alnum, you will have validate against alpha-numeric with exception of underscore and dashalnumOnly alpha-numeric are valid.alphaOnly alphabets are valid.upperOnly upper case alphabets are valid.lowerOnly lower case alphabets are valid.dateFormatcheck the date format to matchcountryFormat\[ alpha2, alpha3, numeric \] check the country data with alpha2 (default for country validation)

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance53

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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

Every ~43 days

Recently: every ~124 days

Total

16

Last Release

2125d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/734c4a5502142de0958b3e298555f3991ee0fd3203995dfa8c0c218835e428f8?d=identicon)[swang](/maintainers/swang)

---

Top Contributors

[![cosmostail](https://avatars.githubusercontent.com/u/2172362?v=4)](https://github.com/cosmostail "cosmostail (1 commits)")[![yourGuy](https://avatars.githubusercontent.com/u/6990064?v=4)](https://github.com/yourGuy "yourGuy (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/revenuewire-validator/health.svg)

```
[![Health](https://phpackages.com/badges/revenuewire-validator/health.svg)](https://phpackages.com/packages/revenuewire-validator)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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