PHPackages                             phalcon/incubator-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. [Framework](/categories/framework)
4. /
5. phalcon/incubator-validation

ActiveLibrary[Framework](/categories/framework)

phalcon/incubator-validation
============================

Phalcon Incubator Validation

v2.1.0(2y ago)2179.4k↓50%5BSD-3-ClausePHPPHP &gt;=7.2CI failing

Since Sep 10Pushed 2y ago6 watchersCompare

[ Source](https://github.com/phalcon/incubator-validation)[ Packagist](https://packagist.org/packages/phalcon/incubator-validation)[ Docs](https://phalcon.io)[ GitHub Sponsors](https://github.com/phalcon)[ Fund](https://opencollective.com/phalcon)[ RSS](/packages/phalcon-incubator-validation/feed)WikiDiscussions master Synced 1mo ago

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

Phalcon\\Incubator\\Validation
==============================

[](#phalconincubatorvalidation)

[![Discord](https://camo.githubusercontent.com/28c6fc95b5decf0e67719a5438501589c00b2db2b15228e67479d6548bbc9f6b/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3331303931303438383135323337353239373f6c6162656c3d446973636f7264)](http://phalcon.io/discord)[![Packagist Version](https://camo.githubusercontent.com/8c44aebe8f0e0807a135bf0ca088d452ebbed8786862a4d71648a33a7671fcf1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068616c636f6e2f696e63756261746f722d76616c69646174696f6e)](https://packagist.org/packages/phalcon/incubator-validation)[![PHP from Packagist](https://camo.githubusercontent.com/584dcbdbfde23a60c46b6f228d8273977106cea2db1a99298645158af8aa4f14/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068616c636f6e2f696e63756261746f722d76616c69646174696f6e)](https://packagist.org/packages/phalcon/incubator-validation)[![codecov](https://camo.githubusercontent.com/3c746e69bb10a432c98e97a3396a39c6129d59626014c2024a98321ab4d3ee8f/68747470733a2f2f636f6465636f762e696f2f67682f7068616c636f6e2f696e63756261746f722d76616c69646174696f6e2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/phalcon/incubator-validation)[![Packagist](https://camo.githubusercontent.com/dfc5f98494c05235a012a40f1ababa8c86aed2e8a50fd975f6a33da9415fcab5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64642f7068616c636f6e2f696e63756261746f722d76616c69646174696f6e)](https://packagist.org/packages/phalcon/incubator-validation/stats)

The reCAPTCHA Validator
-----------------------

[](#the-recaptcha-validator)

### Setup

[](#setup)

Include Javascript API to your site:

```

```

Render reCAPTCHA in your form:

```

```

### Usage

[](#usage)

```
use Phalcon\Forms\Element\Hidden;
use Phalcon\Validation\Validator\ReCaptcha;

$reCaptcha = new Hidden('g-recaptcha-response');

$reCaptcha->setLabel('reCAPTCHA')->addValidators(
    [
        new ReCaptcha(
            [
                'message' => 'The captcha is not valid',
                'secret'  => 'your_site_key',
            ]
        ),
    ]
);

$this->add($reCaptcha);
```

See also:

- [Displaying the widget](https://developers.google.com/recaptcha/docs/display)
- [Verifying the user's response](https://developers.google.com/recaptcha/docs/verify)

IpValidator
-----------

[](#ipvalidator)

The IpValidator validates a valid ip address.

```
$data['ip'] = $this->request->getPost('ip');

$validation = new \Phalcon\Validation();

$validation->add(
    'ip',
    new \MicheleAngioni\PhalconValidators\IpValidator(
        [
            'message' => 'The IP is not valid.', // Optional
        ]
    )
);

$messages = $validation->validate($data);

if (count($messages)) {
    // Some error occurred, handle messages
}
```

// Validation succeeded without errors

NumericValidator
----------------

[](#numericvalidator)

The default NumericValidator only allows for numeric (i.e. 0-9) characters. Minimum and maximum values can be specified.

Optionally, it can support float values, that is allowing a dot (.) character to separate decimals.

Optionally also signed numbers are supported.

```
$data['number'] = $this->request->getPost('number');

$validation = new \Phalcon\Validation();

$validation->add(
    'number',
    new \MicheleAngioni\PhalconValidators\NumericValidator(
        [
            'allowFloat' => true,                                        // Optional, default: false
            'allowSign' => true,                                         // Optional, default: false
            'min' => 2,                                                  // Optional
            'min' => 2,                                                  // Optional
            'max' => 50,                                                 // Optional
            'message' => 'Only numeric (0-9,.) characters are allowed.', // Optional
            'messageMinimum' => 'The value must be at least 2',          // Optional
            'messageMaximum' => 'The value must be lower than 50',       // Optional
        ]
    )
);

$messages = $validation->validate($data);

if (count($messages)) {
    // Some error occurred, handle messages
}

// Validation succeeded without errors
```

AlphaNumericValidator
---------------------

[](#alphanumericvalidator)

The AlphaNumericValidator allows for alphanumeric characters. Optionally, it can allow underscores and white spaces. Minimum and maximum string lengths can be specified.

```
$data['text'] = $this->request->getPost('text');

$validation = new \Phalcon\Validation();

$validation->add(
    'text',
    new \MicheleAngioni\PhalconValidators\AlphaNumericValidator(
        [
            'whiteSpace'     => true,                                            // Optional, default false
            'underscore'     => true,                                            // Optional, default false
            'min'            => 6,                                               // Optional
            'max'            => 30,                                              // Optional
            'message'        => 'Validation failed.',                            // Optional
            'messageMinimum' => 'The value must contain at least 6 characters.', // Optional
            'messageMaximum' => 'The value can contain maximum 30 characters.',  // Optional
        ]
    )
);

$messages = $validation->validate($data);

if (count($messages)) {
    // Some error occurred, handle messages
}

// Validation succeeded without errors
```

AlphaNamesValidator
-------------------

[](#alphanamesvalidator)

The AlphaNamesValidator allows for alphabetic, menus, apostrophe, underscore and white space characters. Optionally, it can allow also numbers (i.t. 0-9). Minimum and maximum string lengths can be specified.

```
$data['text'] = $this->request->getPost('text');

$validation = new \Phalcon\Validation();

$validation->add(
    'text',
    new \MicheleAngioni\PhalconValidators\AlphaNamesValidator(
        [
            'numbers'        => true,                                            // Optional, default false
            'min'            => 6,                                               // Optional
            'max'            => 30,                                              // Optional
            'message'        => 'Validation failed.',                            // Optional
            'messageMinimum' => 'The value must contain at least 6 characters.', // Optional
            'messageMaximum' => 'The value can contain maximum 30 characters.',  // Optional
        ]
    )
);

$messages = $validation->validate($data);

if (count($messages)) {
    // Some error occurred, handle messages
}

// Validation succeeded without errors
```

AlphaCompleteValidator
----------------------

[](#alphacompletevalidator)

The AlphaCompleteValidator allows for alphanumeric, underscore, white space, slash, apostrophe, round and square brackets/parentheses and punctuation characters. Optionally, it can allow also pipes (|), backslashes () and Url Characters (equals (=) and hashtags (#)). Minimum and maximum string lengths can be specified.

```
$data['text'] = $this->request->getPost('text');

$validation = new \Phalcon\Validation();

$validation->add(
    'text',
    new \MicheleAngioni\PhalconValidators\AlphaCompleteValidator(
        [
            'allowBackslashes' => true,                                            // Optional
            'allowPipes'       => true,                                            // Optional
            'allowUrlChars'    => true,                                            // Optional
            'min'              => 6,                                               // Optional
            'max'              => 30,                                              // Optional
            'message'          => 'Validation failed.',                            // Optional
            'messageMinimum'   => 'The value must contain at least 6 characters.', // Optional
            'messageMaximum'   => 'The value can contain maximum 30 characters.',  // Optional
        ]
    )
);

$messages = $validation->validate($data);

if (count($messages)) {
    // Some error occurred, handle messages
}

// Validation succeeded without errors
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~301 days

Total

4

Last Release

1086d ago

Major Versions

v1.0.0 → v2.0.02022-02-07

PHP version history (2 changes)v1.0.0PHP &gt;=7.2

v2.0.0PHP &gt;=7.4

### Community

Maintainers

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

---

Top Contributors

[![jenovateurs](https://avatars.githubusercontent.com/u/3491729?v=4)](https://github.com/jenovateurs "jenovateurs (19 commits)")[![Jeckerson](https://avatars.githubusercontent.com/u/3289702?v=4)](https://github.com/Jeckerson "Jeckerson (11 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![niden](https://avatars.githubusercontent.com/u/1073784?v=4)](https://github.com/niden "niden (1 commits)")[![SharpEV](https://avatars.githubusercontent.com/u/106425039?v=4)](https://github.com/SharpEV "SharpEV (1 commits)")[![tacxou](https://avatars.githubusercontent.com/u/12997062?v=4)](https://github.com/tacxou "tacxou (1 commits)")

---

Tags

ipvalidatorphalconphp-libraryvalidatorframeworkvalidationphalconincubator

###  Code Quality

TestsCodeception

Static AnalysisPHPStan, Psalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phalcon-incubator-validation/health.svg)

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

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k18.5M1.6k](/packages/cakephp-cakephp)[phalcon/incubator

Adapters, prototypes or functionality that can be potentially incorporated to the C-framework.

7222.9M81](/packages/phalcon-incubator)[phalcon/devtools

This tools provide you useful scripts to generate code helping to develop faster and easy applications that use with Phalcon framework.

1.3k2.0M54](/packages/phalcon-devtools)[phalcon/incubator-mailer

Phalcon Incubator Mailer Adapters

1318.1k2](/packages/phalcon-incubator-mailer)[krzysztofrewak/laravel-oop-validator

Laravel Validator object-oriented wrapper

805.8k](/packages/krzysztofrewak-laravel-oop-validator)

PHPackages © 2026

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