PHPackages                             rnr1721/le7-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. [Framework](/categories/framework)
4. /
5. rnr1721/le7-validator

ActiveLibrary[Framework](/categories/framework)

rnr1721/le7-validator
=====================

Simple but great validator for PHP 8

1.0.3(3y ago)0681MITPHPPHP &gt;=8.1

Since May 6Pushed 3y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (5)Used By (1)

le7-validator
=============

[](#le7-validator)

This is a simple and convenient PHP validator. It can be used to validate form input, API requests, and any other data that needs to be validated before being processed.

Requirements
------------

[](#requirements)

- PHP 8.1

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

[](#installation)

```
composer require rnr1721/le7-validator
```

Testing
-------

[](#testing)

```
composer test
```

Usage
-----

[](#usage)

First you need to create an instance of the validator:

```
use Core\Utils\ValidatorFactory;

$validatorFactory = new ValidatorFactory();
$validator = $validatorFactory->getValidator();
```

Then you need to define validation rules for each field:

Method setFullRule can take three arguments:

- **Field** - Field (key) for validate.
- **Value** - Data to validate
- **Rules** - Validation rules
- **Label** - Human-like name of field. It uses for get errors

```
$validator->setFullRule('login', 'john', 'required|minlength:3|maxlength:5', 'Login');
$validator->setFullRule('email', 'admin@example.com', 'required|email', 'User email');
$validator->setFullRule('age', 35, 'min:22|max:55', 'User age');
```

And finally, you can check:

```
if ($validator->validate()) {
    // Validation success
} else {
    // Validation not success
    $errors = $validator->getMessages();
}
```

Present rules
-------------

[](#present-rules)

Rules - is string of "|" - separated rules. For example:

```
minlength:3|maxlength:10|numeric

```

- **required**: The field must be filled
- **min:{n}**: Field value must be at least {n}
- **max:{n}**: Field value must be no more than {n}
- **minlength:{n}**: The length of the string field value must be at least {n}
- **maxlength:{n}**: The length of the string field value must be no more than {n}
- **email**: The field value must be a valid email address
- **notempty**: The field value must not be empty or contain only spaces
- **numeric**: Validates that only numeric data
- **email\_dns**: validates the format of an email address and checks if the domain part of the email address has a valid DNS record
- **url**: Validate URL
- **url\_active**: If URL address is valid and exists
- **date**: Validates that value is date
- **date\_format:{n}**: Validates date format: Example: date\_format:Y-m-d
- **date\_before:{n}**: Validate date before some date. Example: date\_before:2022-05-15
- **date\_after:{n}**: Validate date after some date. Example: date\_after:2022-05-15
- **boolean**: Validate boolean

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

4

Last Release

1098d ago

### Community

Maintainers

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

---

Top Contributors

[![rnr1721](https://avatars.githubusercontent.com/u/122087344?v=4)](https://github.com/rnr1721 "rnr1721 (1 commits)")

---

Tags

frameworkvalidatorcomponentle7le7-framework

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

PHPackages © 2026

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