gawrys/counterparty-laravel
Composer 安装命令:
composer require gawrys/counterparty-laravel
包简介
Laravel bridge for counterparty-verification: service provider, config, validation rules, queued verification job and facade.
README 文档
README
The Laravel bridge for the Counterparty Verification 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
- 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-styleCounterparty::extendRegistry(). - Validation rules -
ActiveVatPayer,NotSanctioned. - Async - queued
VerifyCounterpartyjob dispatching aCounterpartyFlaggedevent. - Selectable strategy & sanctions provider via published config; conditional AI wiring.
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
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.
Testing
composer check # php-cs-fixer + PHPStan max (larastan) + PHPUnit (orchestra/testbench)
Changelog
See CHANGELOG.md.
Contributing & Security
Pull requests welcome. Report security issues privately - see SECURITY.md.
Credits
License
The MIT License (MIT). See LICENSE.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-27