Sorry, no results were found for this search.

EAN Rule

Validate European Article Numbers

140k Downloads / Month

Open Source MIT License

You are viewing the documentation for Intervention Validation Version 3. This version has reached end of life (EOL). Please consider upgrading to version Version 4.

public Intervention\Validation\Rules\Ean::__construct(?int $length = null)

Checks for a valid European Article Number.

Parameters

length (optional)

Optional integer length (8 or 13) to check only for EAN-8 or EAN-13 or either one if not present.

Example

use Intervention\Validation\Rules\Ean;

$validator = Validator::make($request->all(), [
    'attribute-key' => new Ean(8),
]);
Edit