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

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

stantabcorp/validator
=====================

A PHP Validation library

1.3.0(1y ago)01.6kMITPHPPHP &gt;=8.1

Since Mar 21Pushed 1y ago1 watchersCompare

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

READMEChangelog (8)Dependencies (3)Versions (9)Used By (0)

Validator
=========

[](#validator)

A simple PHP validation library

[![PHP Composer](https://github.com/stantabcorp/validator/actions/workflows/php.yml/badge.svg?branch=main)](https://github.com/stantabcorp/validator/actions/workflows/php.yml)

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

[](#installation)

```
composer require stantabcorp/validator
```

Using the library
-----------------

[](#using-the-library)

```
$validator = new \Stantabcorp\Validator\Validator(["array" => ["to" => "validate"]]); // Init the library providing an array to validate.
$validator->required("array.to"); // Test if the key `to` in the array `array` is present.
$validator->array("array"); // Test if the key `array` is an array.

$validator->isValid(); // Return a boolean is the array is valid or not.

$validator->getErrors(); // Return a list of string containing the error messages.
```

### Custom validation

[](#custom-validation)

```
$validator->customValidation("array", function (\Stantabcorp\Validator\CustomValidator $customValidator) {
    $customValidator->getKey(); // The key (`array` in this case)
    $customValidator->getValue(); // The associated value

    // Mark the kay as invalid and add an error message.
    $customValidator->addError("This is an error message");
});
```

Testing
-------

[](#testing)

```
composer run-script test
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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 ~116 days

Recently: every ~132 days

Total

8

Last Release

705d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.4

1.2.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/5327e23311a2e1157e38b676f316ba80ec836408b23a342dec4c0851ea91c19a?d=identicon)[stantabcorp](/maintainers/stantabcorp)

---

Top Contributors

[![thibaultjunin](https://avatars.githubusercontent.com/u/12583049?v=4)](https://github.com/thibaultjunin "thibaultjunin (19 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/stantabcorp-validator/health.svg)](https://phpackages.com/packages/stantabcorp-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)
