PHPackages                             cpuch/barcode-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. cpuch/barcode-validator

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

cpuch/barcode-validator
=======================

Simple validator to check for correctly formatted UPC or EAN barcodes.

v1.0.7(11mo ago)068MITPHPPHP ^8.2|^8.3|^8.4CI passing

Since May 23Pushed 11mo agoCompare

[ Source](https://github.com/cpuch/barcode-validator)[ Packagist](https://packagist.org/packages/cpuch/barcode-validator)[ Docs](https://github.com/cpuch/barcode-validator)[ GitHub Sponsors]()[ RSS](/packages/cpuch-barcode-validator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (7)Versions (9)Used By (0)

Barcode Validator
=================

[](#barcode-validator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/40713f2139f55c858f0ac533c987aca8e90f139f561886e7fe53cb5195ce50d2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63707563682f626172636f64652d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cpuch/barcode-validator)[![GitHub Tests Action Status](https://camo.githubusercontent.com/53ff0bd8afb76ec3f5a24bba35677d9839880c2efe58630dae82bbb91347e2f8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63707563682f626172636f64652d76616c696461746f722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/cpuch/barcode-validator/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/c5489839eeb06f165a69628863bf0147a4dd6e392ae1aad9be591a1fc9cba16a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63707563682f626172636f64652d76616c696461746f722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/cpuch/barcode-validator/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/980b872e09d79230ac706ee19d32b00a0e400f2fe107bd15c9544693f3d8ba1e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63707563682f626172636f64652d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cpuch/barcode-validator)

Simple validator to check for correctly formatted UPC or EAN barcodes.

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

[](#installation)

You can install the package via composer:

```
composer require cpuch/barcode-validator
```

You can publish the translations files with:

```
php artisan vendor:publish --tag="barcode-validator-translations"
```

Usage
-----

[](#usage)

In a controller you can use the class as a validator rule like this :

```
use Cpuch\BarcodeValidator\Rules\BarcodeValidatorRule;

$request->validate([
    'barcode' => ['required', new BarcodeValidatorRule],
]);
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance50

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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

Every ~1 days

Total

8

Last Release

350d ago

### Community

Maintainers

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

---

Top Contributors

[![cpuchalver](https://avatars.githubusercontent.com/u/3123156?v=4)](https://github.com/cpuchalver "cpuchalver (24 commits)")

---

Tags

laravelbarcode-validator

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cpuch-barcode-validator/health.svg)

```
[![Health](https://phpackages.com/badges/cpuch-barcode-validator/health.svg)](https://phpackages.com/packages/cpuch-barcode-validator)
```

###  Alternatives

[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k35.7M107](/packages/propaganistas-laravel-phone)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[laravel-validation-rules/phone

Validate that a phone number is in the correct format

69355.5k](/packages/laravel-validation-rules-phone)[galahad/laravel-addressing

Laravel package providing addressing functionality

70316.6k](/packages/galahad-laravel-addressing)

PHPackages © 2026

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