PHPackages                             gawrys/counterparty-laravel - 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. gawrys/counterparty-laravel

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

gawrys/counterparty-laravel
===========================

Laravel bridge for counterparty-verification: service provider, config, validation rules, queued verification job and facade.

v0.1.3(today)00MITPHPPHP &gt;=8.2CI passing

Since Jun 23Pushed todayCompare

[ Source](https://github.com/igorgawrys1/counterparty-laravel)[ Packagist](https://packagist.org/packages/gawrys/counterparty-laravel)[ RSS](/packages/gawrys-counterparty-laravel/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (12)Versions (5)Used By (0)

Counterparty for Laravel
========================

[](#counterparty-for-laravel)

[![Packagist Version](https://camo.githubusercontent.com/15f86e103439488f4276d0fe394b4f0dea647c8097031350b6d06ad776b38540/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6761777279732f636f756e74657270617274792d6c61726176656c2e737667)](https://packagist.org/packages/gawrys/counterparty-laravel)[![Total Downloads](https://camo.githubusercontent.com/b56ed487cc94565a92ac4328f95eaac6d751389d3b949305d6b8f1c1f9ff206a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6761777279732f636f756e74657270617274792d6c61726176656c2e737667)](https://packagist.org/packages/gawrys/counterparty-laravel)[![CI](https://github.com/igorgawrys1/counterparty-laravel/actions/workflows/ci.yml/badge.svg)](https://github.com/igorgawrys1/counterparty-laravel/actions/workflows/ci.yml)[![PHP](https://camo.githubusercontent.com/dad72c42359ce03cc1cd9d1b3251dcc5769e6f45e218d6149e19bd7bcb1bfac0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e32253230253743253230382e33253230253743253230382e342d3737376262342e737667)](https://www.php.net/)[![Laravel](https://camo.githubusercontent.com/ae68cb0c3d7e225593f8e45f5207b68d01b3ad570566b47089237d5dfafdf7f5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d313125323025374325323031322d6666326432302e737667)](https://laravel.com/)[![PHPStan](https://camo.githubusercontent.com/13c28acdca8687fa00463930452dd171d8fb75635bfc8dddd1a6c3c301decc0c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6d6178253230286c6172617374616e292d627269676874677265656e2e737667)](https://github.com/larastan/larastan)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

The Laravel bridge for the [Counterparty Verification](https://github.com/igorgawrys1/counterparty-core) toolkit: auto-wired service provider, a facade, validation rules, a queued job and an event.

> ⚠️ A **due-diligence aid**, not a guarantee of AML compliance. Risk output is advisory.

Features
--------

[](#features)

- **Zero-config auto-discovery** - PSR contracts mapped onto Laravel's HTTP client, cache and log; reference registries and checks registered for you.
- **Facade** - `Counterparty::verify()` and Storage-style `Counterparty::extendRegistry()`.
- **Validation rules** - `ActiveVatPayer`, `NotSanctioned`.
- **Async** - queued `VerifyCounterparty` job dispatching a `CounterpartyFlagged` event.
- **Selectable strategy &amp; sanctions provider** via published config; conditional AI wiring.

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

[](#installation)

```
composer require gawrys/counterparty-laravel
php artisan vendor:publish --tag=counterparty-config
```

**Zero-config HTTP.** The provider auto-discovers an installed PSR-18 client + PSR-17 factories - on a stock Laravel app this uses the bundled **Guzzle** (Guzzle 7 is a PSR-18 client), so you don't have to install or wire anything. To use a different client, just bind `Psr\Http\Client\ClientInterface` (and the PSR-17 factories) in your app - your binding wins.

Usage
-----

[](#usage)

```
use Gawrys\Counterparty\Laravel\Facades\Counterparty;
use Gawrys\Counterparty\Counterparty as Subject;

$outcome = Counterparty::verify(new Subject('Acme', 'PL', nip: '1234567890'));

Counterparty::extendRegistry('de', fn () => new GermanRegistryDriver(app(JsonHttpClient::class)));
```

Validation:

```
$request->validate([
    'nip'  => ['required', new \Gawrys\Counterparty\Laravel\Rules\ActiveVatPayer()],
    'name' => ['required', new \Gawrys\Counterparty\Laravel\Rules\NotSanctioned()],
]);
```

Async:

```
\Gawrys\Counterparty\Laravel\Jobs\VerifyCounterparty::dispatch($counterparty);
// dispatches Events\CounterpartyFlagged when the outcome is adverse or needs review
```

Set `COUNTERPARTY_STRATEGY=ai` (and install `gawrys/counterparty-ai` + bind an `AiResearchProvider`) to switch to advisory AI scoring - wiring is conditional on the package being present.

Full guide: **[documentation](https://igorgawrys1.github.io/counterparty-verification/laravel/)**.

Testing
-------

[](#testing)

```
composer check   # php-cs-fixer + PHPStan max (larastan) + PHPUnit (orchestra/testbench)
```

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md).

Contributing &amp; Security
---------------------------

[](#contributing--security)

Pull requests welcome. Report security issues privately - see [SECURITY.md](SECURITY.md).

Credits
-------

[](#credits)

- [Igor Gawrys](https://github.com/igorgawrys1)

License
-------

[](#license)

The MIT License (MIT). See [LICENSE](LICENSE).

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

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

Total

4

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b7e3d761ee1d0092d6f4400cf56467f93fa413fbc1cb7bc2e9776903cb52f5f7?d=identicon)[gawrys](/maintainers/gawrys)

---

Tags

laravelvatkycsanctionsdue-diligence

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gawrys-counterparty-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/gawrys-counterparty-laravel/health.svg)](https://phpackages.com/packages/gawrys-counterparty-laravel)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.1k91.3M280](/packages/laravel-horizon)[laravel/sail

Docker files for running a basic Laravel application.

1.9k199.2M1.2k](/packages/laravel-sail)[illuminate/database

The Illuminate Database package.

2.8k54.1M11.1k](/packages/illuminate-database)[laravel/ai

The official AI SDK for Laravel.

9782.1M162](/packages/laravel-ai)[moonshine/moonshine

Laravel administration panel

1.3k239.9k76](/packages/moonshine-moonshine)

PHPackages © 2026

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