PHPackages                             cakephp/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. cakephp/validation

ActiveLibrary[Framework](/categories/framework)

cakephp/validation
==================

CakePHP Validation library

5.3.3(2mo ago)42506.9k↓13.2%812MITPHPPHP &gt;=8.2

Since Nov 14Pushed 1mo ago26 watchersCompare

[ Source](https://github.com/cakephp/validation)[ Packagist](https://packagist.org/packages/cakephp/validation)[ Docs](https://cakephp.org)[ RSS](/packages/cakephp-validation/feed)WikiDiscussions 5.x Synced 1mo ago

READMEChangelogDependencies (8)Versions (339)Used By (12)

[![Total Downloads](https://camo.githubusercontent.com/3ba6b84ad8bb74edb656a889efaf6a41b1d17c807b72c73e01a084b02df88154/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616b657068702f76616c69646174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cakephp/validation)[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)

CakePHP Validation Library
==========================

[](#cakephp-validation-library)

The validation library in CakePHP provides features to build validators that can validate arbitrary arrays of data with ease.

Usage
-----

[](#usage)

Validator objects define the rules that apply to a set of fields. Validator objects contain a mapping between fields and validation sets. Creating a validator is simple:

```
use Cake\Validation\Validator;

$validator = new Validator();
$validator
    ->requirePresence('email')
    ->add('email', 'validFormat', [
        'rule' => 'email',
        'message' => 'E-mail must be valid'
    ])
    ->requirePresence('name')
    ->notEmptyString('name', 'We need your name.')
    ->requirePresence('comment')
    ->notEmptyString('comment', 'You need to give a comment.');

$errors = $validator->validate($_POST);
if ($errors) {
    // display errors.
}
```

Documentation
-------------

[](#documentation)

Please make sure you check the [official documentation](https://book.cakephp.org/5/en/core-libraries/validation.html)

###  Health Score

71

—

ExcellentBetter than 100% of packages

Maintenance88

Actively maintained with recent releases

Popularity48

Moderate usage in the ecosystem

Community38

Small or concentrated contributor base

Maturity95

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

332

Last Release

62d ago

Major Versions

3.10.3 → 4.3.62021-12-17

4.4.9 → 5.0.0-beta12022-11-12

4.4.12 → 5.0.0-beta22023-04-01

4.5.1 → 5.0.0-RC12023-05-14

5.3.3 → 6.x-dev2026-03-17

PHP version history (7 changes)3.4.9PHP &gt;=5.6.0

4.0.0-beta1PHP &gt;=7.2.0

3.9.7PHP &gt;=5.6.0,&lt;8.0.0

4.4.0-RC1PHP &gt;=7.4.0

5.0.0-beta1PHP &gt;=8.1

5.3.0-RC1PHP &gt;=8.2

6.x-devPHP &gt;=8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23666?v=4)[CakePHP](/maintainers/cakephp)[@cakephp](https://github.com/cakephp)

---

Top Contributors

[![markstory](https://avatars.githubusercontent.com/u/24086?v=4)](https://github.com/markstory "markstory (295 commits)")[![ADmad](https://avatars.githubusercontent.com/u/142658?v=4)](https://github.com/ADmad "ADmad (239 commits)")[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (128 commits)")[![lorenzo](https://avatars.githubusercontent.com/u/37621?v=4)](https://github.com/lorenzo "lorenzo (66 commits)")[![othercorey](https://avatars.githubusercontent.com/u/24221186?v=4)](https://github.com/othercorey "othercorey (58 commits)")[![ravage84](https://avatars.githubusercontent.com/u/625761?v=4)](https://github.com/ravage84 "ravage84 (40 commits)")[![robertpustulka](https://avatars.githubusercontent.com/u/7437773?v=4)](https://github.com/robertpustulka "robertpustulka (19 commits)")[![LordSimal](https://avatars.githubusercontent.com/u/9105243?v=4)](https://github.com/LordSimal "LordSimal (15 commits)")[![bcrowe](https://avatars.githubusercontent.com/u/752603?v=4)](https://github.com/bcrowe "bcrowe (13 commits)")[![antograssiot](https://avatars.githubusercontent.com/u/4977112?v=4)](https://github.com/antograssiot "antograssiot (13 commits)")[![Harfusha](https://avatars.githubusercontent.com/u/47174548?v=4)](https://github.com/Harfusha "Harfusha (12 commits)")[![Graziel](https://avatars.githubusercontent.com/u/5963584?v=4)](https://github.com/Graziel "Graziel (12 commits)")[![jeremyharris](https://avatars.githubusercontent.com/u/184903?v=4)](https://github.com/jeremyharris "jeremyharris (11 commits)")[![ndm2](https://avatars.githubusercontent.com/u/5031606?v=4)](https://github.com/ndm2 "ndm2 (9 commits)")[![chinpei215](https://avatars.githubusercontent.com/u/7399393?v=4)](https://github.com/chinpei215 "chinpei215 (8 commits)")[![inoas](https://avatars.githubusercontent.com/u/20972207?v=4)](https://github.com/inoas "inoas (8 commits)")[![ngirardet-mob](https://avatars.githubusercontent.com/u/92201623?v=4)](https://github.com/ngirardet-mob "ngirardet-mob (7 commits)")[![stickler-ci](https://avatars.githubusercontent.com/u/16011037?v=4)](https://github.com/stickler-ci "stickler-ci (6 commits)")[![ypnos](https://avatars.githubusercontent.com/u/8481470?v=4)](https://github.com/ypnos "ypnos (5 commits)")[![dakota](https://avatars.githubusercontent.com/u/83255?v=4)](https://github.com/dakota "dakota (5 commits)")

---

Tags

validationcakephpdata validation

### Embed Badge

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

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

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k18.5M1.6k](/packages/cakephp-cakephp)[composer/installers

A multi-framework Composer library installer

1.4k136.0M6.0k](/packages/composer-installers)[cakephp/authentication

Authentication plugin for CakePHP

1153.6M67](/packages/cakephp-authentication)[cakephp/utility

CakePHP Utility classes such as Inflector, String, Hash, and Security

12127.1M63](/packages/cakephp-utility)[cakephp/orm

CakePHP ORM - Provides a flexible and powerful ORM implementing a data-mapper pattern.

151242.6k70](/packages/cakephp-orm)[cakephp/database

Flexible and powerful Database abstraction library with a familiar PDO-like API

9824.6M33](/packages/cakephp-database)

PHPackages © 2026

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