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

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

cledilsonweb/lontra-validator
=============================

PHP data validators and extra validators for Laminas Framework(getlaminas.org)

0.2.1(4y ago)346MITPHPPHP ^7.1 || ^8.1

Since Nov 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/cledilsonweb/lontra-validator)[ Packagist](https://packagist.org/packages/cledilsonweb/lontra-validator)[ Docs](https://github.com/cledilsonweb/lontra-validator)[ RSS](/packages/cledilsonweb-lontra-validator/feed)WikiDiscussions master Synced 4w ago

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

lontra-validator
================

[](#lontra-validator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/165ca659e1371bad99a86fa225c3c4383263622ec24956048248f9366ab70851/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c6564696c736f6e7765622f6c6f6e7472612d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cledilsonweb/lontra-validator)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/70d5e76d72ad457dc395426a427fbdcaf65f519a7d82c5471b432c72bfc1ecbf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c6564696c736f6e7765622f6c6f6e7472612d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cledilsonweb/lontra-validator)

The lontra-validator is a validator package, a complement to laminas-validator, compatible with validation for laminas-form. It provides an OOP approach.

```
ArrayRecordExists - Check if values in array exists on database
DateBetween - Checks whether the date is between values entered.
DateGreaterThan - Checks if date is greater
DateLessThan - Checks if date is less
EndsWith - If text ends with a value
IsArray - If value is a valid array
Password - Checks whether the entered value is a valid password with the options uppercase, lowercase, number, special characters.
StartsWith - If text starts with a value
WordCount - Validate the number of words in a string
Validator - This class has tools for using laminas-validator and lontra-validator validations

```

Dependencies
------------

[](#dependencies)

lontra-validator depends on laminas-validator (and suggested(but not required) laminas-db to compare with the database), maintained by the Linux Foundation

Install
-------

[](#install)

Via Composer

```
$ composer require cledilsonweb/lontra-validator
```

Usage
-----

[](#usage)

```
$validator = new DateBetween([
    'max' => '2020-10-10',
    'min' => '2020-05-05',
    'format' => 'Y-m-d',
    'inclusive' => true
]);
echo $validator->isValid('2020-06-06'); //true

// Using static validation
echo Validator::isValid(DateBetween::class, '2020-06-06', ['max' => '2020-10-10', 'min' => '2020-05-05']); //true
// Or
echo Validator::validateDateBetween('2020-06-06', ['max' => '2020-10-10', 'min' => '2020-05-05']); //true
```

It is possible to use the validator on the Laminas Form with InputFilter

```
$inputFilter->add(
    [
        'name' => 'input_name',
        'required' => true,
        'filters' => // your filters...,
        'validators' => [
            [
                'name' => DateBetween::class
                'options' => [
                    'max' => '2020-10-10',
                    'min' => '2020-05-05',
                    'format' => 'Y-m-d',
                    'inclusive' => true
                ]
            ]
        ]
    ]
);
```

To customize the validation message:

```
$inputFilter->add(
    [
        'name' => 'input_name',
        'required' => true,
        'filters' => // your filters...,
        'validators' => [
            [
               'name' => DateGreaterThan::class, 'options' => [                       
                'format' => 'Y-m-d',                       
                'min' => 'now',                       
                'messages' => [                           
                    DateGreaterThan::NOT_GREATER_INCLUSIVE => 'A data informada deve ser maior ou igual a data atual',                            DateGreaterThan::NOT_GREATER           => "A data informada deve ser maior que a data atual",                            DateGreaterThan::IVALID_FORMAT         => "A data informada está no formato inválido",                            DateGreaterThan::IVALID_DATE           => "A data informada é inválida",                       
                    ]                   
                ]
            ]
        ]
    ]
);
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

To run the integration test, you need to enable `extension=pdo_sqlite`

Suggestions and Security
------------------------

[](#suggestions-and-security)

If you discover any security related issues or have any suggestions, please [create a new issue](https://github.com/cledilsonweb/lontra-validator/issues/new).

Credits
-------

[](#credits)

- [Cledilson Nascimento](https://github.com/cledilsonweb)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Total

4

Last Release

1481d ago

PHP version history (2 changes)0.0.2PHP ^7.2

0.2.1PHP ^7.1 || ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0b8a6827d5cee9d868b9514fe2a5b8087b68d5025031c7f45a18cf1f91ad85b?d=identicon)[cledilsonweb](/maintainers/cledilsonweb)

---

Top Contributors

[![cledilsonweb](https://avatars.githubusercontent.com/u/44277678?v=4)](https://github.com/cledilsonweb "cledilsonweb (16 commits)")

---

Tags

laminaslaminas-formlaminas-validatorphpvalidatorlaminasvalidatorcledilsonweblontra-validator

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[respect/validation

The most awesome validation engine ever created for PHP

5.9k37.4M380](/packages/respect-validation)[composer/spdx-licenses

SPDX licenses list and validation library.

1.4k184.2M25](/packages/composer-spdx-licenses)[laminas/laminas-validator

Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria

15544.9M187](/packages/laminas-laminas-validator)[opis/json-schema

Json Schema Validator for PHP

64236.9M185](/packages/opis-json-schema)[laminas/laminas-escaper

Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs

22088.6M140](/packages/laminas-laminas-escaper)[laminas/laminas-form

Validate and display simple and complex forms, casting forms to business objects and vice versa

8112.0M115](/packages/laminas-laminas-form)

PHPackages © 2026

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