Download the PHP package intragile/laravel-hungarian-validation without Composer

On this page you can find all versions of the php package intragile/laravel-hungarian-validation. 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 laravel-hungarian-validation

Laravel Hungarian Validation

Developed and maintained by IntrAgile Kft.

Tests Latest Version PHP

Validation, normalisation, formatting and test data for Hungarian identifiers: tax number (adószám), EU VAT number (közösségi adószám), personal tax ID (adóazonosító jel), TAJ number, domestic bank account number, Hungarian IBAN, company registration number (cégjegyzékszám) and postal code (irányítószám).

Magyar nyelvű leírás → README.hu.md

Why this package?

Existing PHP packages for Hungarian identifiers mostly match a regular expression. As a result they accept tax numbers with VAT code 0, accept personal tax IDs whose check digit the law forbids, and accept company registration numbers with form codes that do not exist. Some implement the tax number check digit incorrectly and reject real tax numbers. None of them covers the IBAN together with the inner GIRO check, or the rule that the second check digit of a 24-digit account covers 16 digits. Every one of these cases is a regression test here.

Requirements

Installation

The service provider is discovered automatically. To customise the messages:

Core usage (any PHP project)

Every identifier class has the same API:

validate() returns the first rule the value breaks, as a Violation (Format, Checksum, VatCode, Region, BirthDate, BirthDateMismatch, TaxNumberMismatch, Court, CompanyForm, Range, Length, NotAllowed, SettlementMismatch), or null when the value is valid. parse() throws an InvalidIdentifierException that carries the violation.

Separators are ignored wherever they appear: spaces (including no-break spaces), hyphens, Unicode dashes, the minus sign, dots and slashes.

Identifiers

Class Example (format()) Checks Parts
TaxNumber (adószám) 10773381-2-44 check digit of the base number, VAT code 1–5, territorial code baseNumber(), vatCode(), regionCode(), euVatNumber()
EuVatNumber (közösségi adószám) HU17780010 HU prefix, check digit baseNumber(), matches(TaxNumber)
TaxIdentificationNumber (adóazonosító jel) 8412721233 leading 8, check digit, embedded birth date not in the future birthDate(), serial(), matchesBirthDate()
TajNumber 123 456 788 check digit
BankAccountNumber 11773016-11111018 GIRO check digits, 16 or 24 digits bankCode(), branchCode(), length(), toIban()
Iban HU42 1177 3016 1111 1018 0000 0000 HU, 28 characters, MOD 97-10 and the inner GIRO check bankAccount(), fromBankAccount()
CompanyRegistrationNumber (cégjegyzékszám) 01-10-041683 court of registration, company form court(), form(), serial()
PostalCode (irányítószám) 1052 structure and the issued ranges isBudapest(), budapestDistrict(), settlements(), matchesSettlement()

Laravel validation

Each identifier has a rule object and a string rule:

Rule object String rule Options
new HungarianTaxNumber(vatCode: [2, 4]) hu_tax_number:vat_code=2,vat_code=4 allowed VAT codes
new HungarianEuVatNumber('tax_number') hu_eu_vat_number:matches=tax_number must match the tax number in another field
new HungarianTaxIdentificationNumber('born_on') hu_tax_id:birth_date=born_on must match the birth date in another field; birthDate: takes a fixed date
new HungarianTajNumber hu_taj
new HungarianBankAccountNumber(16) hu_bank_account:length=16 16 or 24 digits only
new HungarianIban hu_iban
new HungarianCompanyRegistrationNumber(CompanyForm::Kft) hu_company_number:form=09 allowed company forms
new HungarianPostalCode(budapestOnly: true, settlementField: 'city') hu_postal_code:budapest,settlement=city Budapest only; must belong to the settlement in another field

The rule classes live in IntrAgile\HungarianValidation\Laravel\Rules.

Test data

Each identifier has a generator in IntrAgile\HungarianValidation\Generators. Pass a seeded Random\Randomizer for reproducible output. In Laravel, the Faker provider is registered automatically:

Outside Laravel: $faker->addProvider(new HungarianIdentifierProvider($faker));.

Rules and sources

Identifier Rule Source
Tax number Weights 9, 7, 3, 1, 9, 7, 3 on digits 1–7; digit 8 = (10 − sum mod 10) mod 10. VAT code 1–5. Territorial code 02–20, 22–44 or 51. Céginformációs Szolgálat; NAV Online Számla common.xsd; NAV's notice on taxpayer data (afaalany_taj.html, archived 2008–2021)
EU VAT number HU + the 8-digit base number, same check digit as above
Personal tax ID Digit 1 = 8; digits 2–6 = days since 1867-01-01; digit 10 = Σ(digitᵢ × i) mod 11; a remainder of 10 is never issued 1996. évi XX. törvény, annex 1
TAJ number Digits in odd positions × 3, in even positions × 7; digit 9 = sum mod 10 1996. évi XX. törvény, annex 2
Bank account Weights 9, 7, 3, 1 repeated. Digits 1–8 form one group; digits 9–16 (or 9–24) form a second group 35/2017. (XII. 14.) MNB rendelet, annex 1, point 1
IBAN HU + 2 check digits + 24-digit BBAN, ISO 7064 MOD 97-10, check digits 02–98 35/2017. MNB rendelet, annex 1, point 2; MNB
Company registration number Court 01–20; company form code from the official list; no check digit 21/2006. (V. 18.) IM rendelet, annex 2
Postal code 4 digits; Budapest 1007 and 1011–1999; other codes 2000–9999 KSH Helységnévtár; Magyar Posta

Limitations

Testing

Security

See SECURITY.md.

License

The code is MIT licensed, see LICENSE. The bundled postal code data is CC BY 4.0, see DATA-LICENSE.md.


Developed and maintained by IntrAgile Kft..


All versions of laravel-hungarian-validation with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
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 intragile/laravel-hungarian-validation contains the following files

Loading the files please wait ...