Download the PHP package davidlares/gs1-ai without Composer

On this page you can find all versions of the php package davidlares/gs1-ai. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package gs1-ai

GS1 AI Laravel Package

This is a Laravel-based package designed to interact with an GS1 Application Identifiers API, providing structured DTOs, collections, and a rule-based engine for working with identifiers, validations, qualifiers, exclusions, and requirements.

What are GS1 Application Identifiers (AIs)?

GS1 Application Identifiers (AIs) are standardized numeric prefixes used in barcodes (like GS1-128, DataMatrix, QR codes) to define the meaning and format of the data that follows.

For example: (01)09506000134352

01 → AI (Global Trade Item Number - GTIN) and 09506000134352 → actual data

Each AI defines:

This package helps you consume, structure, and reason about this metadata programmatically.

Features

Identifier general data

This is the associated specification for the identifier, it basically describes the identifier itself.

Field Meaning
ai Application Identifier code
title Short name
description Human-readable explanation
regex Validation pattern
separator Whether FNC1 separator is required
is_gs1_digital_link_pk Can be used as Digital Link primary key
is_valid_for_data_attributes Can act as attribute
note Associated note to the identifier

Validation data

Defines how the data should be validated.

Field Meaning
fixed_length Must be exact length
is_optional Field may be omitted
check_digit Includes check digit
key Primary key relevance
format Special format rule
length Expected length
type Data type (N = numeric, X = alphanumeric)

Installation

Install via Composer:

Setup

Run the install command:

This will publish the configuration file:

Configuration

Add your API URL in .env:

Basic Usage

Accessing General Information

Boolean Helpers

Validations

Helpers

Exclusions / Requirements / Qualifiers

DTO (Data Transfer Objects)

All API responses are converted into structured objects:

This ensures:

Collections

Array-based sections are converted into Laravel Collections:

This enables:

Rule Engine

Exclusions, Requirements, and Qualifiers are modeled as logical rules:

Example:

Meaning:

Architecture

Core Classes

Identifier

Main entry point.

Methods

General

Represents metadata of an identifier.

Methods

Validation

Represents a validation rule.

Properties

Exclusion / Requirement / Qualifier

Logical rule representation.

Methods

Testing

This package supports testing via:

Example setup:

Run:

Error Handling

You can use the built-in Laravel exception for this

Example:

Credits

David Lares S

License

MIT


All versions of gs1-ai with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package davidlares/gs1-ai contains the following files

Loading the files please wait ...