PHPackages                             simfatic/boar - 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. simfatic/boar

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

simfatic/boar
=============

Form validation library in PHP

v1.0.1(4y ago)1301MITPHP

Since Nov 4Pushed 4y ago2 watchersCompare

[ Source](https://github.com/simfatic/boar)[ Packagist](https://packagist.org/packages/simfatic/boar)[ RSS](/packages/simfatic-boar/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (3)Used By (1)

Boar - Self-documenting PHP Form validation library
===================================================

[](#boar---self-documenting-php-form-validation-library)

```
$v = Boar::create()
$v->field("name")->isRequired()->alphabetic()->maxLen(50)
$v->fields(["email", "address"])->areRequired()->maxLen(50)

$res = $v->validate($post_values)

if($res->hasErrors())
{
    echo json_encode($res->errors);
}
```

Customizing the error message
-----------------------------

[](#customizing-the-error-message)

```
$v->field("name")->maxLength(10)->withMessage("name should be shorter than {{max_length}}");
```

The message string is a template. `{{field}}` is replaced with the name of the field. For example, `"{{field}} is required."` when used with field `address` becomes `"address is required"`. The message template can contain values from the specific validation as well. For example, `max_length` for MaxLength validation and `min_length` for MinLength validation.

All validations should be explicitly declared
---------------------------------------------

[](#all-validations-should-be-explicitly-declared)

```
$v->field("name")->maxLength(10)->alphabetic();

$res = $v->validate([]); //No Error.
```

if name is a required field, should call isRequired() explicitly

```
$v->field("name")->isRequired()->maxLength(10)->alphabetic();

$res = $v->validate([]); //Error.
```

Similarly,

```
$v->field("weight")->min(100);

$res = $v->validate(["weight"=>"not a number"]); //No Error.
```

minimum validation will not validate for the data type. If the value is not number, it will silently ignore.

```
$v->field("weight")->isNumber()->min(100);

$res = $v->validate(["weight"=>"not a number"]); //Error.
```

Keeping the granularity of the validation helps in predictable behavior and reduces ambiguity.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

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

Total

2

Last Release

1701d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/968329?v=4)[Prasanth Janardhanan](/maintainers/prasanthmj)[@prasanthmj](https://github.com/prasanthmj)

---

Top Contributors

[![prasanthmj](https://avatars.githubusercontent.com/u/968329?v=4)](https://github.com/prasanthmj "prasanthmj (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/simfatic-boar/health.svg)

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

PHPackages © 2026

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