aichadigital / lararoi
Agnostic package for intra-community NIF-VAT/VAT verification. Designed primarily for use with Larabill.
Fund package maintenance!
:vendor_name
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 2
pkg:composer/aichadigital/lararoi
Requires
- php: ^8.3
- ext-json: *
- ext-soap: *
- illuminate/contracts: ^11.0||^12.0
- illuminate/database: ^11.0||^12.0
- illuminate/http: ^11.0||^12.0
- illuminate/support: ^11.0||^12.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- mockery/mockery: ^1.5
- nunomaduro/collision: ^8.8
- nunomaduro/phpinsights: ^2.13
- orchestra/testbench: ^10.0.0||^9.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/laravel-ray: ^1.35
This package is auto-updated.
Last update: 2025-12-06 18:00:05 UTC
README
⚠️ BETA VERSION - Active Development This package is currently in beta (v0.2.x). The API and configuration may change significantly in future versions. Use in production at your own risk. We recommend pinning to a specific version in your
composer.json.
Agnostic package for intra-community NIF-VAT/VAT verification in Laravel.
Description
Lararoi is an independent package that provides services to verify tax identification numbers (NIF-VAT) of intra-community operators in the European Union. It is designed to be agnostic and reusable, although its main use is as a dependency of the Larabill package.
Features
- ✅ Verification via VIES (European Commission)
- ✅ Support for multiple API providers (free and paid)
- ✅ Integrated caching system (memory + database)
- ✅ Automatic fallback between providers
- ✅ Robust error handling
- ✅ Logging and auditing
- ✅ Development commands for testing with real APIs
Installation
composer require aichadigital/lararoi
Configuration
Publish the configuration:
php artisan vendor:publish --provider="Aichadigital\Lararoi\LararoiServiceProvider" --tag="config"
Publish the migrations:
php artisan vendor:publish --provider="Aichadigital\Lararoi\LararoiServiceProvider" --tag="migrations" php artisan migrate
Basic Usage
use Aichadigital\Lararoi\Contracts\VatVerificationServiceInterface; $service = app(VatVerificationServiceInterface::class); $result = $service->verifyVatNumber('B12345678', 'ES'); if ($result['is_valid']) { echo "Valid VAT: " . $result['company_name']; }
Documentation
Complete documentation is available in the docs/ directory:
- Usage Guide - Basic usage, configuration, and examples
- Configuration - Detailed configuration options and environment variables
- Integration Guide - How to integrate with other packages (e.g., Larabill)
- Project Information - Complete documentation of available APIs and services
- Development Guide - Development commands and testing with real APIs
- Contributing - Guidelines for developers and contributors
- License - MIT License
Testing & Quality
The package maintains high quality standards with:
- ✅ Automated tests with Pest PHP
- ✅ Static analysis with PHPStan (level 5)
- ✅ Code style with Laravel Pint
- ✅ Code coverage minimum of 20%
- ✅ CI/CD with GitHub Actions
To run tests locally:
# Run tests composer test # Run tests with coverage composer test:coverage # Static analysis with PHPStan composer analyse # Format code composer format
License
The MIT License (MIT). Please see License File for more information.