Download the PHP package mvdnbrk/gtin without Composer
On this page you can find all versions of the php package mvdnbrk/gtin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package gtin
Short Description GTIN / EAN / UPC Validation for Laravel
License MIT
Homepage https://github.com/mvdnbrk/gtin
Informations about the package gtin
GTIN / EAN / UPC Validation for Laravel
Extension for the Laravel validation class.
Installation
You can install the package via composer:
Usage
Now you can use the gtin
validation to validate a GTIN-8, GTIN-12, GTIN-13 or GTIN-14:
Specifying a custom error message
You may publish the language files with the following artisan
command:
Now you can customize the error message in resources/lang/vendor/gtin/{loale}/validation.php
.
Another option is to define the error message by adding your message to the custom
array in the resources/lang/{locale}/validation.php
language file.
Or with a JSON file stored in resources/lang/{locale}.json
Or you may pass custom messages as the third argument to the Validator::make
method as described in the Laravel documentation.
Helper function
This package exposes a is_gtin()
helper function to quickly validate a GTIN.
It will return a boolean
whether the given value is a valid GTIN or not:
Migrations
This package contains a helper method to create a GTIN column in your database table:
If you would like to customize the column name and/or length you may pass these as parameters:
To drop the column you may use the dropGtin
method:
Testing
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Mark van den Broek
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of gtin with dependencies
illuminate/support Version ^5.5 || ^6.0 || ^7.0 || ^8.0|| ^9.0
illuminate/validation Version ^5.5|| ^6.0 || ^7.0 || ^8.0|| ^9.0