PHPackages                             aliengen/pachyderm-validation - 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. aliengen/pachyderm-validation

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

aliengen/pachyderm-validation
=============================

A Micro validation framework for Pachyderm

0358↓85.7%PHP

Since Feb 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/AlienGen/pachyderm-validation)[ Packagist](https://packagist.org/packages/aliengen/pachyderm-validation)[ RSS](/packages/aliengen-pachyderm-validation/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Pachyderm Validation
====================

[](#pachyderm-validation)

Pachyderm Validation is a PHP library for Pachyderm, designed to provide a robust and flexible validation framework for your applications. It offers a wide range of built-in validators and allows for easy extension to meet custom validation needs.

Features
--------

[](#features)

- **Comprehensive Validators**: Includes a variety of validators such as `Required`, `Email`, `Min`, `Max`, `Between`, `Regex`, and more.
- **Customizable**: Easily extend the library with custom validators.
- **Nested Validation**: Supports validation of nested fields using dot notation.
- **Exception Handling**: Throws detailed exceptions for validation errors.

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

[](#installation)

To install the library, use Composer:

```
composer require pachyderm/validation
```

Run the tests
-------------

[](#run-the-tests)

```
composer test
```

Usage
-----

[](#usage)

To use the library, you can create a new instance of the `Validator` class and pass the data you want to validate to the `validate` method.

```
use Pachyderm\Validation\Validator;
$validator = Validator::getInstance();
$errors = $validator->validate('required|email', $value);
if (!empty($errors)) {
    // Handle validation errors
}
```

### Request Validation

[](#request-validation)

For validating request data, extend the `RequestValidator` class and define your rules:

```
use Pachyderm\Validation\RequestValidator;

class MyRequestValidator extends RequestValidator
{
    protected function rules(): array
    {
        return [
            'name' => 'required|string',
            'age' => 'required|integer|min:18',
            'email' => 'required|email'
        ];
    }
}
```

### Object Validation

[](#object-validation)

You can validate objects using dot notation to access nested properties:

```
$validator = Validator::getInstance();
$rules = [
    'user.name' => 'required|string',
    'user.email' => 'required|email',
    'user.profile.age' => 'required|integer|min:18'
];

$data = [
    'user' => [
        'name' => 'John Doe',
        'email' => 'john@example.com',
        'profile' => [
            'age' => 25
        ]
    ]
];
$errors = Validator::validate($rules, $data);
```

### Array Validation

[](#array-validation)

For validating arrays or collections, you can use the `array` validator along with other rules:

```
$rules = [
    'items' => 'required|array',
    'items.*.id' => 'required|integer',
    'items.*.name' => 'required|string|min:3',
    'items.*.price' => 'required|numeric|min:0'
];

$data = [
    'items' => [
        [
            'id' => 1,
            'name' => 'Product 1',
            'price' => 29.99
        ],
        [
            'id' => 2,
            'name' => 'Product 2',
            'price' => 49.99
        ]
    ]
];

$errors = Validator::validate($rules, $data);
```

### Custom Validators

[](#custom-validators)

To create a custom validator, implement the `ValidatorInterface`:

```
use Pachyderm\Validation\ValidatorInterface;

class MyCustomValidator implements ValidatorInterface
{
    public function validate($value, $rule): bool
    {
        // Implement your custom validation logic here
        return $value === 'custom';
    }
}
```

License
-------

[](#license)

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/711667?v=4)[Timothé Mermet-Buffet](/maintainers/mermetbt)[@mermetbt](https://github.com/mermetbt)

---

Top Contributors

[![mermetbt](https://avatars.githubusercontent.com/u/711667?v=4)](https://github.com/mermetbt "mermetbt (12 commits)")

### Embed Badge

![Health badge](/badges/aliengen-pachyderm-validation/health.svg)

```
[![Health](https://phpackages.com/badges/aliengen-pachyderm-validation/health.svg)](https://phpackages.com/packages/aliengen-pachyderm-validation)
```

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