Download the PHP package asignua/filament-vat-id without Composer

On this page you can find all versions of the php package asignua/filament-vat-id. 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 filament-vat-id

Filament VAT ID

Filament VAT ID

Tests

Validate and look up tax identifiers in Filament forms. Offline rules check the format and the checksum of EU VAT numbers (all 27 member states and Northern Ireland), Polish NIP and REGON, Czech IČO and DIČ and Ukrainian ЄДРПОУ and РНОКПП. An optional "Look up" button asks a company registry (VIES, the Polish white list, GUS, ARES) and fills the name, address, REGON and bank accounts into the sibling fields. No API key is needed except for GUS.

Screenshots

One click on the search icon looks the company up and fills name, address, REGON and bank account:

Looking a company up by its VAT number

Numbers are checked offline first — format and check digits — before any registry is asked:

A checksum error for a mistyped number

Formatted tax IDs in a table

Dark mode:

Dark mode

Requirements

Installation

Registering the plugin is optional (the fields and rules work without it); it only gives the panel provider a place to add registries:

Publish the config when you need to change anything: php artisan vendor:publish --tag=filament-vat-id-config.

Usage

The input

An EU VAT number carries its country prefix (PL5260250995) or takes the country from country() / countryField() (5260250995 + PL); a prefix that contradicts the country is an error. Greece is EL in VIES; GR works as the country. Separators (spaces, dots, dashes) are ignored. ->normalized() saves the value without them.

The other types have a fixed country, so they need no country:

->type() keeps Filament's meaning for strings (->type('tel') is still the HTML input type); only a TaxIdType (or a closure returning one) sets the identifier type.

What the button does: it validates the number offline, asks the registries that support the country and type (in the configured order, the first with data wins), fills the mapped fields, shows the company name under the field and sends a notification. "Not found", "registry unavailable" and "no registry for this country" are notifications, not exceptions. Mapped values that are empty are skipped, so a lookup never wipes what the user typed.

->vies() adds a remote check on save, after the offline rule. It is answered only by registries that are authoritative for the type, never by a domestic list:

Type Remote check answered by Otherwise
EuVat VIES only (a domestic register such as the white list does not prove a VAT-UE registration) -
CzIco, CzDic ARES a birth-number DIČ of an individual cannot be resolved: the check is skipped, not failed
PlNip, PlRegon GUS (existence in REGON; needs a key) without a key the check is skipped. A white-list miss is never treated as "does not exist": it only means "not an active VAT payer"
UaEdrpou, UaRnokpp none skipped

A company the registry marks inactive (closed in GUS, ended in ARES) is rejected too. The lookup button, in contrast, asks every registry that supports the type, in the configured order, so the white list still fills bank accounts. What happens when no registry answers is decided by on_unavailable (see Configuration; it applies to ->vies() and to RegisteredTaxId alike). ->registry(Vies::class) pins the check and the lookup to one registry. A non-EU country on an EU VAT field (UA, US…) means there is nothing to validate: the value passes offline and remotely.

Rules

TaxId works offline; a blank value passes (add required). Rules\RegisteredTaxId is the remote counterpart. To use the checks outside validation:

Offline checks

Type Checked
EU VAT format of every member state + XI; checksum for AT, BE, CZ, DE, DK, EE, EL, ES, FI, FR, HR, HU, IE, IT, LT, LU, LV, MT, NL, PL, PT, RO, SE, SI, SK, XI. Format only: BG, CY (and French numbers with a letter in the key, Latvian natural persons)
PlNip 10 digits, weights 6 5 7 2 3 4 5 6 7, mod 11
PlRegon 9 digits (weights 8 9 2 3 4 5 6 7) or 14 digits (plus weights 2 4 8 5 0 9 7 3 6 1 2 4 8)
CzIco 8 digits, weights 8 7 6 5 4 3 2, mod 11
CzDic 8 digits = IČO; 9-10 digits = birth number (date + mod 11); 9 digits starting with 6 = format only
UaEdrpou 8 digits, the official two-pass weighting (1..7, then 3..9; 7 1 2 3 4 5 6 for numbers 30 000 000 - 60 000 000)
UaRnokpp 10 digits, weights -1 5 7 9 4 6 10 5 7, mod 11, mod 10

A checksum proves the number is well-formed, not that the company exists. Use the registries for that.

The entry

With asignua/filament-iban

There is no dependency in either direction. The lookup writes plain strings, so map a returned IBAN into any field:

Only the Polish white list returns bank accounts (as IBANs, PL + the 26-digit account number). A company can have dozens; bankAccounts.0 is simply the first one the registry lists.

Registries

Country Source Class Key Returns
EU + XI VIES REST Vies no valid flag; name and address where the member state shares them (--- becomes empty)
PL MF white list (Biała lista) BialaLista no name, address (+ street / postcode / city), VAT status, NIP, REGON, KRS, bank accounts
PL GUS BIR 1.1 (SOAP) GusBir yes (FILAMENT_VAT_ID_GUS_KEY) name, address, NIP, REGON, whether the business was closed
CZ ARES REST Ares no name, address (+ street / postcode / city), DIČ, IČO, ended or not. IČO (8 digits) only; a birth-number DIČ is not found
UA none free - - validation only

Each registry answers supports($country, $type) without touching the network. CompanyData holds name, address, street, city, postcode, country, vatNumber, regon, ico, registryId (KRS for Poland), active, status, bankAccounts (IBANs), source and the registry's own record in raw.

Ukraine and other countries

There is no free, stable, key-less registry for Ukrainian companies, so UaEdrpou and UaRnokpp are validated offline only. To add one (a paid provider, your own database, a different country), implement the contract and list the class:

Configuration

Key Default
registries white list, GUS, ARES, VIES Registry classes in order of preference; resolved from the container
timeouts.connect / timeouts.request 3 / 6 s Per registry call
total_timeout 12 s Upper bound for one lookup or verification across all registries; verification also stops at the first unavailable registry
cache.enabled / ttl / store / prefix on / 3600 s / default store "Found" and "not found" are cached per registry, country, type and number; "unavailable" never. The GUS session id is cached separately and always (about 50 minutes), whatever cache.enabled says
on_unavailable warn When remote verification (->vies(), RegisteredTaxId) gets no answer: allow accepts silently; warn accepts and shows a notification (only inside a Filament form); fail rejects
gus.key FILAMENT_VAT_ID_GUS_KEY GUS is disabled while empty
gus.environment FILAMENT_VAT_ID_GUS_ENV = prod test uses the public test endpoint and key abcde12345abcde12345 (scrambled data)

Gotchas

Data and privacy

A lookup or a ->vies() check sends the identifier (and nothing else) to the registry: VIES (European Commission), the Ministry of Finance white list, GUS or ARES, depending on the country. Those are public registers, but you are still transmitting a number your user typed, so mention it in your privacy notice when the number identifies a sole proprietor (a Polish NIP, a Czech birth-number DIČ, a Ukrainian РНОКПП). Results are kept in your cache for cache.ttl seconds and are never written to a database by this package. Set cache.enabled to false to keep nothing. The package sends a User-Agent: asignua-filament-vat-id header and no tracking of any kind.

Translations

The interface ships in English, Ukrainian, German, Spanish, French, Italian, Dutch, Polish, Brazilian Portuguese and Turkish under the filament-vat-id::filament-vat-id namespace. A test keeps every language in step with the English keys. Override a string by publishing the translations (--tag=filament-vat-id-translations) and editing the copy in lang/vendor/filament-vat-id.

AI agents

The package ships Laravel Boost guidelines (resources/boost/guidelines/core.blade.php) so a coding agent wires it up correctly.

Testing

Changelog

See CHANGELOG.md.

License

The MIT License (MIT). See LICENSE.md.


All versions of filament-vat-id with dependencies

PHP Build Version
Package Version
Requires ext-dom Version *
ext-simplexml Version *
filament/filament Version ^5.0
illuminate/contracts Version ^12.0|^13.0
php Version ^8.3
spatie/laravel-package-tools Version ^1.16
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 asignua/filament-vat-id contains the following files

Loading the files please wait ...