PHPackages                             dmt-software/gtin-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. dmt-software/gtin-validator

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

dmt-software/gtin-validator
===========================

Symfony validator to validate GTIN

0.1.0(1y ago)00MITPHPPHP &gt;=8.3

Since May 16Pushed 1y ago2 watchersCompare

[ Source](https://github.com/dmt-software/gtin-validator)[ Packagist](https://packagist.org/packages/dmt-software/gtin-validator)[ RSS](/packages/dmt-software-gtin-validator/feed)WikiDiscussions main Synced 1mo ago

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

GTIN Validator
==============

[](#gtin-validator)

Validator to validate GTIN numbers.

An UPC number is equal to a GTIN-12 number, EAN or GLN are GTIN-13 numbers and can be validated using the corresponding size.

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

[](#installation)

```
composer require dmt-software/gtin-validator
```

Usage
-----

[](#usage)

```
use DMT\GTIN\Validator\GTIN;
use Symfony\Component\Validator\Validator\ValidatorInterface;

class Product
{
    #[GTIN(size: 13, message: 'Invalid EAN code.')]
    public string $ean;
}

$product = new Product();
$product->ean = '49923315534218';

/** @var ValidatorInterface $validator */
$errors = $validator->validate($product);

if (count($errors) > 0) {
    foreach ($errors as $error) {
        echo $error->getMessage() . ' ' . $error->getCause();
    }
}

// prints: Invalid EAN code. Number length is not correct.
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance50

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

367d ago

### Community

Maintainers

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

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

---

Top Contributors

[![proggeler](https://avatars.githubusercontent.com/u/18281353?v=4)](https://github.com/proggeler "proggeler (1 commits)")

---

Tags

symfonyvalidatorbarcodeeanupcgtin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dmt-software-gtin-validator/health.svg)

```
[![Health](https://phpackages.com/badges/dmt-software-gtin-validator/health.svg)](https://phpackages.com/packages/dmt-software-gtin-validator)
```

###  Alternatives

[intervention/validation

Additional validation rules for the Laravel framework

6826.7M8](/packages/intervention-validation)[rollerworks/password-strength-validator

Password-strength validator for Symfony

1455.7M6](/packages/rollerworks-password-strength-validator)[real-digital/gtin-validator

Real GTIN Validator

17414.3k1](/packages/real-digital-gtin-validator)[mvdnbrk/gtin

GTIN / EAN / UPC Validation for Laravel

3148.6k1](/packages/mvdnbrk-gtin)[sllh/iso-codes-validator

Symfony validator wrapper of ronanguilloux/isocodes

37299.8k2](/packages/sllh-iso-codes-validator)[imelgrat/barcode-validator

A PHP class for validating EAN, IMEI, ISBN, GTIN, SSCC, GSIN, UPC and other barcodes.

2188.1k](/packages/imelgrat-barcode-validator)

PHPackages © 2026

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