cpuch / barcode-validator
Simple validator to check for correctly formatted UPC or EAN barcodes.
Fund package maintenance!
Cedric Puchalver
Requires
- php: ^8.2|^8.3|^8.4
- illuminate/contracts: ^11.0||^12.0
Requires (Dev)
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.0.0||^9.0.0||^8.22.0
- pestphp/pest: ^3.0
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
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.