PHPackages                             padavvan/yii2-luhn-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. padavvan/yii2-luhn-validator

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

padavvan/yii2-luhn-validator
============================

Luhn validate

1.0.2(8y ago)141MITPHPPHP &gt;=5.4.0

Since Jul 12Pushed 8y ago2 watchersCompare

[ Source](https://github.com/padaVVan/yii2-luhn-validator)[ Packagist](https://packagist.org/packages/padavvan/yii2-luhn-validator)[ Docs](https://github.com/padaVVan/yii2-luhn-validator)[ RSS](/packages/padavvan-yii2-luhn-validator/feed)WikiDiscussions master Synced 3d ago

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

Standalone Luhn validator for Yii2
==================================

[](#standalone-luhn-validator-for-yii2)

Checking the number by Luhn algorithm. Look more about [Luhn algorithm](luhn) at wikipedia.

For license information check the [LICENSE](license)-file.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](https://getcomposer.org/download/).

Either run

```
php composer.phar require padavvan/yii2-luhn-validator
```

or add

```
"padavvan/yii2-luhn-validator": "~1.0.2"

```

to the require section of your composer.json file.

Usage
-----

[](#usage)

Look more about [Yii2 validators](http://www.yiiframework.com/doc-2.0/guide-input-validation.html)

```
public function rules() {
  return [
    ['creditCard', LuhnValidator::className()]
  ];
}

// OR
$model = \yii\base\DynamicModel::validateData(['digits' => '...'], [
    ['digits', LuhnValidator::className()]
]);

// OR
LuhnValidator::check($digits); // return true or false
```

Tests
-----

[](#tests)

```
cd vendor/padavvan/yii2-luhn-validator
php ../../bin/codecept run
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

2

Last Release

3228d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2add63e44fdeaa2c6da74b9b0bcafedc245e87baad6917b5a06998ac3e570ac3?d=identicon)[padaVVan](/maintainers/padaVVan)

---

Top Contributors

[![padaVVan](https://avatars.githubusercontent.com/u/493343?v=4)](https://github.com/padaVVan "padaVVan (13 commits)")

---

Tags

validatoryii2luhn

### Embed Badge

![Health badge](/badges/padavvan-yii2-luhn-validator/health.svg)

```
[![Health](https://phpackages.com/badges/padavvan-yii2-luhn-validator/health.svg)](https://phpackages.com/packages/padavvan-yii2-luhn-validator)
```

###  Alternatives

[paulzi/yii2-json-behavior

Yii2 json attribute behavior

76528.6k3](/packages/paulzi-yii2-json-behavior)[codeonyii/yii2-at-least-validator

Validates at least one (or more) attributes.

28253.5k1](/packages/codeonyii-yii2-at-least-validator)[arogachev/yii2-many-to-many

Many-to-many ActiveRecord relation for Yii 2 framework

3541.2k4](/packages/arogachev-yii2-many-to-many)[dstotijn/yii2-json-schema-validator

A Yii2 extension that provides a validator class for JSON Schema validation.

1730.7k](/packages/dstotijn-yii2-json-schema-validator)[insolita/yii2-array-structure-validator

Validate array with complex structure

1326.4k2](/packages/insolita-yii2-array-structure-validator)

PHPackages © 2026

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