PHP code example of mvdnbrk / gtin

1. Go to this page and download the library: Download mvdnbrk/gtin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mvdnbrk / gtin example snippets


$this->validate($request, [
    'somefield' => 'gtin',
]);

'custom' => [
    'somefield' => [
        'gtin' => 'Please enter a valid GTIN!',
    ],
],

is_gtin('1300000000000')    // returns true
is_gtin('1234567891234')    // returns false

Schema::table('products', function (Blueprint $table) {
    $table->gtin();
});

$table->gtin('ean13', 13);

Schema::table('products', function (Blueprint $table) {
    $table->dropGtin();
    
    // $table->dropGtin('ean13');
});
bash
php artisan vendor:publish --tag=gtin-lang