Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Vatin Bundle

Vatin Bundle Laravel Package

ddeboer/vatin-bundle

Symfony bundle integrating ddeboer/vatin. Validates EU VAT ID (VATIN) format via Symfony Validator and can optionally verify existence via the VIES SOAP service. Also exposes services for direct VATIN validation and VIES lookups.

View on GitHub
Deep Wiki
Context7

Symfony bundle for the VATIN library

Frequently asked questions about Vatin Bundle
Can I use ddeboer/vatin-bundle in Laravel even though it’s a Symfony bundle?
Yes, but you’ll need to adapt it. The bundle relies on Symfony’s validator and service container, so you can either wrap it in a Laravel service layer or use a Symfony bridge like `spatie/laravel-symfony-support`. Laravel 9+ works best due to Symfony 8 compatibility.
What Laravel versions support ddeboer/vatin-bundle?
Laravel 9 and 10 are officially recommended due to Symfony 8 alignment. Laravel 8 may work with manual dependency pinning (e.g., Symfony 6.x), but PHP 8.1+ is required. Test thoroughly for version conflicts.
How do I integrate this bundle into Laravel’s validation system?
Use the `Vatin` constraint in Form Requests or model properties (e.g., `#[Vatin]`). For Laravel’s validator, bind the Symfony validator service to Laravel’s container or create a custom rule extending `Vatin`. Example: `Validator::extend('vatin', fn ($attr, $value, $params) => $validator->isValid($value));`
What happens if the VIES SOAP service is down during VAT existence checks?
The bundle throws a `ValidatorException`. Handle it gracefully with fallbacks: cache responses locally (e.g., Redis), use offline validation, or notify admins. Avoid critical-path failures by prioritizing format validation over API checks.
Are there performance concerns with real-time VIES API calls?
Yes. VIES API calls are slow (~1–3 seconds) and unreliable. Cache responses aggressively (e.g., 24-hour TTL) and avoid calling it on every request. For high-traffic apps, batch checks or use a queue system like Laravel Queues.
Can I validate non-EU VAT numbers (e.g., US sales tax, Canadian GST) with this package?
No. This bundle is EU-focused. For non-EU VAT, use the `formatOnly: true` option to validate structure only, then implement custom logic for other tax systems. Consider libraries like `league/tax-vat` for broader support.
How do I install ddeboer/vatin-bundle in Laravel without Symfony?
Run `composer require ddeboer/vatin-bundle`. Manually register the bundle’s services in Laravel’s container by binding `ddeboer_vatin.vatin_validator` and `ddeboer_vatin.vies.client` to their Symfony equivalents. Use `app()->make()` or Laravel’s service provider.
What’s the difference between `checkExistence: false` and `true` in the Vatin constraint?
`checkExistence: false` validates VAT format only (fast, no API calls). `true` adds a VIES API check (slow, unreliable). Use `false` for offline systems or when API failures aren’t critical. Example: `#[Vatin(checkExistence: false)]`
Are there alternatives to ddeboer/vatin-bundle for Laravel?
Yes. For format validation, use `league/tax-vat` (pure PHP, no API). For VIES checks, consider `mikehaertl/php-vies` (Laravel-specific wrapper). If you need both, this bundle is the most feature-complete but requires Symfony integration.
How do I test VAT validation in Laravel’s unit tests?
Mock the VIES client service to return predictable responses. Use Laravel’s `partialMock` or `createMock` to simulate API failures or valid/invalid VATs. Example: `Mockery::mock('ddeboer_vatin.vies.client')->shouldReceive('checkVat')->andReturn(new CheckVatResponse(true));`
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dualmedia/log-bundle
codyas/spreadsheet-bundle
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
directorytree/opensearch-client
directorytree/opensearch-adapter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php