cpuch / barcode-validator
Simple validator to check for correctly formatted UPC or EAN barcodes.
Fund package maintenance!
v1.0.8
2026-11-26 14:19 UTC
Requires
- php: ^8.2
- illuminate/contracts: ^11.0||^12.0||^13.0
Requires (Dev)
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1
- orchestra/testbench: ^11.0||^10.0||^9.0
- pestphp/pest: ^3.0||^4.0
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5||^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Simple validator to check for correctly formatted UPC or EAN barcodes.
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
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
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.