PHPackages                             patrickjunod/avs-checker - 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. patrickjunod/avs-checker

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

patrickjunod/avs-checker
========================

AVS Checker - A library for AVS / AHV Number validation

2.0.0(4y ago)12.1k↑37.5%MITPHPPHP ^8.0

Since Sep 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/PatrickJunod/avs-checker)[ Packagist](https://packagist.org/packages/patrickjunod/avs-checker)[ Docs](https://github.com/patrickjunod/avs-checker)[ GitHub Sponsors](https://github.com/PatrickJunod)[ RSS](/packages/patrickjunod-avs-checker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (5)Used By (0)

AVS Checker - A library for AVS / AHV Number validation
=======================================================

[](#avs-checker---a-library-for-avs--ahv-number-validation)

[![Latest Version on Packagist](https://camo.githubusercontent.com/257b0fff95b3b4784fad09aa42c54b32e591ddc0b84318bc8104462c252991b0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7061747269636b6a756e6f642f6176732d636865636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/patrickjunod/avs-checker)[![GitHub Tests Action Status](https://camo.githubusercontent.com/4f7ab8f768952a19aac3aad3bad300f65ca750bc0809327ba6500ee83d672eb3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7061747269636b6a756e6f642f6176732d636865636b65722f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/patrickjunod/avs-checker/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d125fac3dafbfb34babab0b21a7d5cbef9116f05486a27638f48b9ecc18c7e21/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7061747269636b6a756e6f642f6176732d636865636b65722f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/patrickjunod/avs-checker/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/91b4d8a7f9d94addbce2e834278ab92c6e36a31972b5fbc2760758e1e473b0e9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7061747269636b6a756e6f642f6176732d636865636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/patrickjunod/avs-checker)

This small library helps you to validate Swiss Social Security Numbers (AVS / AHV). It will check against regex and checksums to be sure that the number is valid.

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

[](#installation)

You can install the package via composer:

```
composer require patrickjunod/avs-checker
```

Usage
-----

[](#usage)

You can use the AVS Checker as a standalone PHP Package:

```
use PatrickJunod\AvsChecker\AvsChecker;

$avsNumber = new AvsChecker('756.3026.0705.92');
$avsNumber->isValid();
// Return true if it's a valid AVS Number, false if not
```

### Facade

[](#facade)

Or use it with a facade:

```
use PatrickJunod\AvsChecker\Facades\AvsChecker;

$avsNumber = AvsChecker::isValid('756.3026.0705.92');
// Return true if it's a valid AVS Number, false if not
```

### Validate without strict mode

[](#validate-without-strict-mode)

You can also validate AVS numbers without dots separation by passing false parameter to the isValid method. This option will validate AVS numbers with AND without dots.

```
use PatrickJunod\AvsChecker\AvsChecker;

$avsNumber = AvsChecker::isValid('7563026070592', false);
// Return true
```

### Validate an array of AVS Numbers

[](#validate-an-array-of-avs-numbers)

You can also validate an array of AVS numbers - with or without strict mode

```
use PatrickJunod\AvsChecker\AvsChecker;

$avsNumber = AvsChecker::isValid(['7563026070592', '756.2036.0705.92', 'AAA'], false);
// Return an array:
[
  0 => [
    "number" => "7563026070592",
    "isValid" => true
  ],
  1 => [
    "number" => "756.2036.0705.92",
    "isValid" => true
  ],
  2 => [
    "number" => "AAA",
    "isValid" => false
  ]
]
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Patrick Junod](https://github.com/PatrickJunod)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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 ~47 days

Total

4

Last Release

1560d ago

Major Versions

1.0.2 → 2.0.02022-02-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/00620f134a0a22c8b4e7880dd4915f883b0b41a17143127d83c9f20a30552247?d=identicon)[PatrickJunod](/maintainers/PatrickJunod)

---

Top Contributors

[![PatrickJunod](https://avatars.githubusercontent.com/u/29105077?v=4)](https://github.com/PatrickJunod "PatrickJunod (12 commits)")

---

Tags

laravelPatrickJunodavs-checker

###  Code Quality

TestsPest

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/patrickjunod-avs-checker/health.svg)

```
[![Health](https://phpackages.com/badges/patrickjunod-avs-checker/health.svg)](https://phpackages.com/packages/patrickjunod-avs-checker)
```

###  Alternatives

[askedio/laravel5-profanity-filter

A Vendor Package Example

52354.1k](/packages/askedio-laravel5-profanity-filter)[laravel-validation-rules/us-state

Validate US States and Canada Provinces

16172.7k](/packages/laravel-validation-rules-us-state)[pacerit/laravel-polish-validation-rules

Simple Polish Validation rules for Laravel and Lumen framework

1449.9k](/packages/pacerit-laravel-polish-validation-rules)[laravel-validation-rules/ip

Validate if an ip address is public or private.

1629.7k](/packages/laravel-validation-rules-ip)[janvince/smallcontactform

Simple but flexible multi language contact form builder with custom fields, validation and passive antispam

307.4k](/packages/janvince-smallcontactform)[basillangevin/laravel-data-json-schemas

Transforms Spatie Data objects into JSON Schemas with built-in validation

1312.2k1](/packages/basillangevin-laravel-data-json-schemas)

PHPackages © 2026

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