PHPackages                             hybridmind/validate - 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. hybridmind/validate

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

hybridmind/validate
===================

A robust and flexible validation library for PHP.

1.0.0(1y ago)05MITPHPPHP &gt;=7.4

Since Nov 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/HybridMind1337/Validate)[ Packagist](https://packagist.org/packages/hybridmind/validate)[ RSS](/packages/hybridmind-validate/feed)WikiDiscussions main Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Validate Class
==============

[](#validate-class)

The `Validate` class offers a robust and flexible way to handle validation logic in your PHP applications. This class simplifies and centralizes validation rules, making your code cleaner and more maintainable.

Features
--------

[](#features)

- **Simplified Code**: Reduce boilerplate and repetitive validation logic.
- **Centralized Validation Rules**: Manage all your validation logic in one place.
- **Improved Readability**: Declarative syntax for clearer, more maintainable code.
- **Extensible**: Easily add new validation rules as needed.

Before and After
----------------

[](#before-and-after)

Before Manual validation logic often leads to repetitive code:

```
if (empty($_POST['username'])) {
    $errors[] = 'Username is required.';
} elseif (strlen($_POST['username']) < 3) {
    $errors[] = 'Username must be at least 3 characters long.';
} elseif (strlen($_POST['username']) > 20) {
    $errors[] = 'Username cannot exceed 20 characters.';
}
```

After Using the Validate class streamlines the process:

```
$validate = new Validate();

$validationResult = $validate->check($_POST, [
    'username' => [
        Validate::REQUIRED => ['message' => 'Username is required.'],
        Validate::MIN => ['min' => 3, 'message' => 'Username must be at least 3 characters long.'],
        Validate::MAX => ['max' => 20, 'message' => 'Username cannot exceed 20 characters.'],
    ],
]);

if ($validate->isValid()) {
    // Proceed with processing
} else {
    $errors = $validate->getErrors();
    // Handle validation errors
}
```

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

[](#installation)

To use the `Validate` class, simply include the class file in your project.

```
composer require hybridmind/validate

```

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

[](#contributing)

We welcome contributions to enhance the Validate class. To contribute, please follow these steps:

1. Fork the repository.
2. Create a new branch.
3. Make your changes and commit them with clear and descriptive messages.
4. Push your changes to the branch.
5. Submit a pull request.

License
-------

[](#license)

This project is licensed under the MIT License. See the LICENSE file for details.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

605d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5382845?v=4)[Dave Evans](/maintainers/hybridmind)[@HybridMind](https://github.com/HybridMind)

---

Top Contributors

[![HybridMind1337](https://avatars.githubusercontent.com/u/12223569?v=4)](https://github.com/HybridMind1337 "HybridMind1337 (9 commits)")

### Embed Badge

![Health badge](/badges/hybridmind-validate/health.svg)

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

###  Alternatives

[marcosh/php-validation-dsl

A DSL for validating data in a functional fashion

483.9k](/packages/marcosh-php-validation-dsl)

PHPackages © 2026

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