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 1mo ago

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 27% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

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

559d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fbb6b2beb5e0939710efaeb5c95001163a5b48ddf2082e232179b75a55c22264?d=identicon)[hybridmind](/maintainers/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

[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)
