aichadigital/lararoi
Composer 安装命令:
composer require aichadigital/lararoi
包简介
Agnostic package for intra-community NIF-VAT/VAT verification. Designed primarily for use with Larabill.
README 文档
README
Lararoi is the Laravel package that owns the intra-community VAT/NIF verification domain: the verification itself, its cache, and a multi-consumer tracking/audit log — served to consuming apps through explicit, stable contracts and agnostic configuration. Consumers (billing, accounting, …) consume it; they never reimplement the domain.
The verification model is provider-agnostic (VIES SOAP/REST, isvat, viesapi, vatlayer) with automatic fallback and per-country syntax validation. See the architecture decisions (ADR-001, ADR-002) for the domain-ownership rationale.
Features
- ✅ VAT/NIF verification via VIES (European Commission) + multiple free/paid providers, with automatic fallback
- ✅ Per-country syntax validation (short-circuits obviously invalid numbers without hitting a provider)
- ✅ TTL cache (memory + database), one current row per NIF, enforced by a UNIQUE key
- ✅ Multi-consumer tracking / audit log — append-only, consumer-attributed, inert by default
- ✅ Per-consumer retention (declared in config, UTC) with a prune command
- ✅ Per-consumer output mapping — adapt the canonical result to your own shape without forking code
- ✅ Formal, documented contract set — swap the model, the tracking model, or the mapper via config/contracts
- ✅ Robust, typed error handling; development commands for testing against real APIs
Requirements
- PHP 8.3+
- Laravel 12+
Installation
composer require aichadigital/lararoi
The database schema is package-managed — just run migrations, no stub to publish:
php artisan migrate
This creates the cache table roi_vat_verifications and the tracking table roi_verification_queries. Optionally publish the config to tune providers, cache, tracking and retention:
php artisan vendor:publish --tag="lararoi-config"
Basic Usage
use Aichadigital\Lararoi\Contracts\VatVerificationServiceInterface; $result = app(VatVerificationServiceInterface::class) ->verifyVatNumber('B12345678', 'ES'); if ($result['is_valid']) { echo "Valid VAT: {$result['company_name']}"; }
Tracking is off by default. A consumer that wants an audit trail enables lararoi.tracking.enabled, registers itself in the lararoi.consumers allow-list (with a retention policy), and passes a VerificationContext — see the Integration Guide.
Documentation
- Integration Guide — install → verify → track → retain → map (the full consumer flow)
- Contracts — the public contract set (interfaces, value object, exceptions)
- Configuration — config keys and environment variables
- Usage Guide — usage patterns and examples
- Architecture Decisions — ADR-001 (domain ownership), ADR-002 (v1.0 design)
- Development Guide — development commands and testing with real APIs
- Contributing — guidelines for contributors
Testing & Quality
- Pest PHP test suite, PHPStan level 5, Laravel Pint, GitHub Actions CI.
composer test # run the suite composer quality # pint + phpstan + tests
License
The MIT License (MIT). Please see License File for more information.
Credits
aichadigital/lararoi 适用场景与选型建议
aichadigital/lararoi 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 921 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 11 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「vat」 「laravel」 「vies」 「verification」 「NIF」 「iva」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 aichadigital/lararoi 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aichadigital/lararoi 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 aichadigital/lararoi 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Library to format data from VIES service (http://ec.europa.eu/taxation_customs/vies/?locale=en)
A VAT number check (Web Service) Plugin for CakePHP
Validate the format of EU vat numbers.
PHP VAT checker based on the European Commission web service
EU VAT (BTW) validator for Laravel — VIES with automatic fallbacks (controleerbtwnummer.eu, btw-opzoeken.be), 24h cache, address parsing.
A Laravel package for interacting with the VIES (VAT Information Exchange System) REST API, allowing validation of VAT numbers within the European Union.
统计信息
- 总下载量: 921
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 31
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-15