PHPackages                             carloswph/valium-pt - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. carloswph/valium-pt

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

carloswph/valium-pt
===================

Validation for the Portuguese market.

v1.1.0(5y ago)537[1 issues](https://github.com/carloswph/valium-pt/issues)MITPHP

Since Apr 10Pushed 5y ago2 watchersCompare

[ Source](https://github.com/carloswph/valium-pt)[ Packagist](https://packagist.org/packages/carloswph/valium-pt)[ RSS](/packages/carloswph-valium-pt/feed)WikiDiscussions main Synced yesterday

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Valium Portugal
===============

[](#valium-portugal)

Valium is an initiative that envisions to offer validation classes in PHP for checking public and official numbers and codes for different countries. This particular library focuses in the Portuguese market. This package already manages to validade the following numbers:

- NIF/NIPC
- NISS
- IBAN
- BI

Usage
=====

[](#usage)

Each type of number has its own class, and can be used by instantiating the respective class and using the method check() with the array of numbers/codes to be validated. The method returns an array with the codes as keys and a boolean check as value. For the NIF, the method also admits a second parameter (false as default). If TRUE, the second parameter not only validates the NIF number, but also returns the description of the type of tax payer, instead of a boolean result.

```
use Valium\PT\Nif;
use Valium\PT\Niss;
use Valium\PT\Iban;
use Valium\PT\Bi;

require __DIR__ . '/vendor/autoload.php';

$nif = new Nif();
// Returns a bool for each number in the array
$q = $nif->check([720014360, '291653170', 980547490, 281234500, 510837620]);
// Returns the type of tax payer for each valid number
$r = $nif->check([292679411, '720014360', 980547490, 281234500, 510837620], true);

var_dump($q);
var_dump($r);

$niss = new Niss();
// Returns a bool for each number in the array
$s = $niss->check([12060903799, 12073833086, 12060904475]);

var_dump($s);

$iban = new Iban();
// Returns a bool for each account in the array
$t = $iban->check(['PT50003300004549519501405', 'PT50001200004549519501405']);

var_dump($t);

$bi = new Bi();
// As an input, an array of the BI numbers together with the control digit (the first number before the two letters, XX, XY, i.e)
$x = $bi->check(['108015750', '34521320']);

var_dump($x);
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~4 days

Total

2

Last Release

1951d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/78516217?v=4)[Carlos Artur Curvelo da Silva Matos](/maintainers/carloswph)[@carloswph](https://github.com/carloswph)

---

Top Contributors

[![meuppt](https://avatars.githubusercontent.com/u/37983141?v=4)](https://github.com/meuppt "meuppt (8 commits)")

---

Tags

validationIBANNIFportugalFinançascontribuintesegurança socialniss

### Embed Badge

![Health badge](/badges/carloswph-valium-pt/health.svg)

```
[![Health](https://phpackages.com/badges/carloswph-valium-pt/health.svg)](https://phpackages.com/packages/carloswph-valium-pt)
```

###  Alternatives

[intervention/validation

Additional validation rules for the Laravel framework

6837.4M22](/packages/intervention-validation)[ronanguilloux/isocodes

PHP library - Validators for standards from ISO, International Finance, Public Administrations, GS1, Book and Music Industries, Phone numbers &amp; Zipcodes for many countries

8043.5M27](/packages/ronanguilloux-isocodes)[opis/json-schema

Json Schema Validator for PHP

65446.2M365](/packages/opis-json-schema)[jschaedl/iban-validation

A small library for validating International BankAccount Numbers (IBANs).

1023.3M19](/packages/jschaedl-iban-validation)[cmpayments/iban

IBAN utility library

34390.0k5](/packages/cmpayments-iban)[iamfarhad/validation

🇮🇷 Complete Laravel Persian validation package - Iranian national ID, mobile numbers, Shamsi dates, IBAN/Sheba, postal codes &amp; more. Modern Laravel 10-13 support with both ValidationRule objects &amp; string-based rules.

3017.4k](/packages/iamfarhad-validation)

PHPackages © 2026

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