PHP code example of davidlares / gs1-ai

1. Go to this page and download the library: Download davidlares/gs1-ai 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/ */

    

davidlares / gs1-ai example snippets


use Davidlares\GS1\AI\Facades\Identifier;

$identifier = Identifier::find('01');

$identifier->ai();
$identifier->description();
$identifier->title();
$identifier->regex();
$identifier->note();

$identifier->containSeparator();
$identifier->containDigitalLinkQualifiers();

foreach ($identifier->validations as $validation) {
    $validation->length;
    $validation->fixed_length;
}

$identifier->amountOfvalidators();

foreach ($identifier->exclusions as $rule) {
    $rule->ais();
    $rule->belongsToGroup();
}

$identifier->validations
$identifier->exclusions
$identifier->

$identifier->validations->count();
$identifier->validations->first();

["02", ["10", "21"]]

try {
    Identifier::find('01');
} catch (\Exception $e) {
    // handle error
}
bash
php artisan gs1-ai:install
bash
config/gs1-ai.php

02 OR (10 AND 21)