PHPackages                             gourmet/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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. gourmet/validation

ActiveCakephp-plugin[Validation &amp; Sanitization](/categories/validation)

gourmet/validation
==================

Extra validation providers and rules for CakePHP 3

v1.0.1(11y ago)420.4k↑66.7%3MITPHP

Since Mar 27Pushed 9y ago2 watchersCompare

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

READMEChangelogDependencies (4)Versions (3)Used By (0)

Validation
==========

[](#validation)

[![Build Status](https://camo.githubusercontent.com/5790d5ba320c89e181d126c36ab0aa9a1e4ca607d100bb575a0685ab6bb9db7c/68747470733a2f2f7472617669732d63692e6f72672f676f75726d65742f76616c69646174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/gourmet/validation)[![Total Downloads](https://camo.githubusercontent.com/a9ea79d1f456e2ae02ad0c71f44c751495a0e334bc19630ea756e9a1a1a407b1/68747470733a2f2f706f7365722e707567782e6f72672f676f75726d65742f76616c69646174696f6e2f646f776e6c6f6164732e737667)](https://packagist.org/packages/gourmet/validation)[![License](https://camo.githubusercontent.com/91f56abf88b1221f59595d971af6c65a10663150d433a2fb304bdc09bea923e6/68747470733a2f2f706f7365722e707567782e6f72672f676f75726d65742f76616c69646174696f6e2f6c6963656e73652e737667)](https://packagist.org/packages/gourmet/validation)

Extra validation providers and rules for [CakePHP 3](http://cakephp.org)

Install
-------

[](#install)

Using [Composer](http://getcomposer.org):

```
composer require gourmet/validation:~1.0

```

This plugin does not require to be loaded in bootstrap as it only uses autoloaded classes.

Usage
-----

[](#usage)

In any table's `validationDefault()` method:

```
public function validationDefault(Validator $validator)
{
    $validator
        ->provider('respect', new \Gourmet\Validation\Validation\RespectProvider())
        ->provider('iso', new \Gourmet\Validation\Validation\IsoCodesProvider())

        ->add('country_code', 'valid', [
            'provider' => 'respect',
            'rule' => 'countryCode',
        ])

        ->add('zip_code_by_country_code', 'valid', [
            'rule' => function($value, $context) {
                $provider = $context['providers']['respect'];
                $country = $context['data']['country_code'];
                return $provider->__call('postalCode', [$value, $country]);
            }
        ])

        ->add('zip_code_by_country', 'valid', [
            'rule' => function($value, $context) {
                $provider = $context['providers']['iso'];
                $country = $context['data']['country'];
                return $provider->__call('zip_code', [$value, $country]);
            }
        ])

        ->add('book_code', 'valid', [
            'provider' => 'iso',
            'rule' => 'isbn10'
        ])
}
```

For more, check out the supported validation methods for each of the official libraries the providers proxy:

- [Respect\\Validation](http://respect.li/Validation)
- [IsoCodes](https://github.com/ronanguilloux/IsoCodes)

Patches &amp; Features
----------------------

[](#patches--features)

- Fork
- Mod, fix
- Test - this is important, so it's not unintentionally broken
- Commit - do not mess with license, todo, version, etc. (if you do change any, bump them into commits of their own that I can ignore when I pull)
- Pull request - bonus point for topic branches

Bugs &amp; Feedback
-------------------

[](#bugs--feedback)

License
-------

[](#license)

Copyright (c) 2015, Jad Bitar and licensed under [The MIT License](http://www.opensource.org/licenses/mit-license.php).

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~27 days

Total

2

Last Release

4042d ago

### Community

Maintainers

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

---

Top Contributors

[![jadb](https://avatars.githubusercontent.com/u/33527?v=4)](https://github.com/jadb "jadb (8 commits)")[![soullivaneuh](https://avatars.githubusercontent.com/u/1698357?v=4)](https://github.com/soullivaneuh "soullivaneuh (2 commits)")

---

Tags

cakephpgourmet

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[admad/cakephp-i18n

A CakePHP plugin for I18n related tools.

4449.5k](/packages/admad-cakephp-i18n)[ichikaway/cakeplus

Cake plus is cakephp plugin and provides some functions for CakePHP.

52101.1k1](/packages/ichikaway-cakeplus)[chrisshick/cakephp3-html-purifier

This is a CakePHP3 Purifier Plugin Behavior that cleanses data before it is marshalled into the entity.

12168.1k](/packages/chrisshick-cakephp3-html-purifier)[gourmet/social-meta

Adds Facebook Open Graph and Twitter Cards support to CakePHP 3.x

255.1k](/packages/gourmet-social-meta)[gourmet/email

Gourmet Email Plugin for rapid CakePHP application development.

175.2k](/packages/gourmet-email)[gourmet/filters

Dispatcher filters (middlewares) for CakePHP 3

102.8k](/packages/gourmet-filters)

PHPackages © 2026

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