PHPackages                             antonioprimera/cif - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. antonioprimera/cif

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

antonioprimera/cif
==================

VAT Number Utility

v1.1.0(1mo ago)016MITPHPPHP ^8.4CI failing

Since May 19Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/AntonioPrimera/cif)[ Packagist](https://packagist.org/packages/antonioprimera/cif)[ Docs](https://github.com/antonioprimera/cif)[ RSS](/packages/antonioprimera-cif/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (10)Versions (5)Used By (0)

VAT Number Utility
==================

[](#vat-number-utility)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require antonioprimera/cif
```

Usage
-----

[](#usage)

### Format validation (offline)

[](#format-validation-offline)

Validate the shape of a VAT number (RO checksum + a generic fallback for other countries):

```
use AntonioPrimera\Cif\Cif;

cif('RO46801317')->isValid();        // true  (valid RO checksum)
Cif::from('46801317')->isValid();    // true  (defaults to RO)
cif('RO46801318')->isValid();        // false

$cif = Cif::from('RO46801317');
$cif->countryCode();                 // 'RO'
$cif->withoutCountryCode();          // '46801317'
```

### Online registry lookup (ANAF + VIES)

[](#online-registry-lookup-anaf--vies)

Verify that a VAT number belongs to a real, active entity **and** fetch the company data. Romanian codes are checked against **ANAF**, the rest of the EU against **VIES**:

```
use AntonioPrimera\Cif\Lookup\VatLookup;

$result = (new VatLookup())->lookup('RO46801317'); // or '46801317', 'DE123456789', 'EL094…'

$result->isValid();          // entity exists and is active
$result->vatPayer;           // registered for VAT (→ reverse-charge)
$result->name;               // 'ECOBAT ENERGY S.R.L.'
$result->address;            // fiscal address
$result->postalCode;
$result->registrationNumber; // RO: nr. Reg. Comerțului
$result->source;             // 'anaf' | 'vies'
$result->status;             // 'valid' | 'invalid' | 'unverified'
```

`unverified` means the registry (ANAF/VIES) could not be reached — treat it as "could not verify", **never** as invalid, so an outage doesn't reject a real VAT number.

The default HTTP client uses `ext-curl`. To use your own (e.g. in tests, or a framework's HTTP client), implement `Lookup\HttpClient` and inject it:

```
$lookup = new VatLookup($myHttpClient);
```

> Note: lookups are not cached inside the package — wrap `lookup()` with your own cache (ANAF/VIES can be slow), since results for a given VAT number rarely change within a day.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Antonio Primera](https://github.com/AntonioPrimera)

License
-------

[](#license)

This package is licensed under the [Proprietary Software License](LICENSE.md). Please see the [LICENSE](LICENSE.md) file for more information.

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance90

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~202 days

Total

3

Last Release

50d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/77cac31fc31444fb45ef19e3628a7b243b5456679a9e6db635aa3b979bfdbefc?d=identicon)[AntonioPrimera](/maintainers/AntonioPrimera)

---

Top Contributors

[![AntonioPrimera](https://avatars.githubusercontent.com/u/23128666?v=4)](https://github.com/AntonioPrimera "AntonioPrimera (5 commits)")[![mariuspasca](https://avatars.githubusercontent.com/u/71263203?v=4)](https://github.com/mariuspasca "mariuspasca (2 commits)")

---

Tags

vatCIFPrimera Digital Agency

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/antonioprimera-cif/health.svg)

```
[![Health](https://phpackages.com/badges/antonioprimera-cif/health.svg)](https://phpackages.com/packages/antonioprimera-cif)
```

###  Alternatives

[mpociot/vat-calculator

EU VAT calculation, the way it should be.

1.3k4.3M28](/packages/mpociot-vat-calculator)[ibericode/vat

PHP library for dealing with EU VAT

4473.6M15](/packages/ibericode-vat)[commerceguys/tax

Tax library with a flexible data model, predefined tax rates, powerful resolving logic.

286786.9k](/packages/commerceguys-tax)[ddeboer/vatin-bundle

Symfony bundle for the VATIN library

30946.6k](/packages/ddeboer-vatin-bundle)[ibericode/vat-bundle

Bundle for using ibericode/vat in a Symfony environment

21282.4k](/packages/ibericode-vat-bundle)[sylius/taxation

Flexible taxation system for PHP ecommerce applications.

11424.7k12](/packages/sylius-taxation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
