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

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

phpsoftbox/validator-db
=======================

Database validation contract for the PhpSoftBox framework

v1.2.1(2w ago)0117↓82.2%MITPHPPHP ^8.4

Since Feb 3Pushed 2w agoCompare

[ Source](https://github.com/phpsoftbox/validator-db)[ Packagist](https://packagist.org/packages/phpsoftbox/validator-db)[ RSS](/packages/phpsoftbox-validator-db/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (6)Versions (6)Used By (0)

PhpSoftBox Validator DB
=======================

[](#phpsoftbox-validator-db)

Контракты для интеграции валидатора с базой данных.

Установка
---------

[](#установка)

```
composer require phpsoftbox/validator-db
```

Использование
-------------

[](#использование)

```
use PhpSoftBox\Validator\Db\Contracts\DatabaseBulkValidationAdapterInterface;
use PhpSoftBox\Validator\Db\Contracts\ExistingValuesQueryInterface;
use PhpSoftBox\DatabaseLookup\LookupSpec;

final class MyAdapter implements DatabaseBulkValidationAdapterInterface
{
    public function exists(string $table, array $criteria, ?string $connection = null): bool
    {
        // ...
    }

    public function existingValues(LookupSpec $lookup, ?string $connection = null): ExistingValuesQueryInterface
    {
        // Возвращает query object.
        // Обычное выполнение: ->fetch()
        // С прогревом: ->warmup()->fetch()
    }

    public function unique(
        string $table,
        array $criteria,
        ?string $connection = null,
        ?string $ignoreColumn = null,
        mixed $ignoreValue = null,
    ): bool {
        // ...
    }
}
```

Если adapter не поддерживает bulk-проверки, он может реализовать только `DatabaseValidationAdapterInterface`. Для правил вроде `ExistsValidation::all()`нужен `DatabaseBulkValidationAdapterInterface`.

Лицензия
--------

[](#лицензия)

MIT

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance96

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

Total

5

Last Release

18d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0279d150240c97d210034878b0467462246dc14d29b5618157ff6a8be49a50e3?d=identicon)[inspector-who](/maintainers/inspector-who)

---

Top Contributors

[![inspector-who](https://avatars.githubusercontent.com/u/6973963?v=4)](https://github.com/inspector-who "inspector-who (5 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/phpsoftbox-validator-db/health.svg)](https://phpackages.com/packages/phpsoftbox-validator-db)
```

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