- How do I install danielebarbaro/laravel-vat-eu-validator?
- Install it with Composer using composer require danielebarbaro/laravel-vat-eu-validator. Laravel package auto-discovery registers the service provider and facade, and you can publish the config file if you need to adjust VIES client settings. Then add the validation rule to your form requests or controllers.
- Which Laravel and PHP versions are supported by laravel-vat-eu-validator?
- The package targets Laravel 8 and newer with PHP 7.4 or PHP 8.x, but version constraints can change between releases. Check the composer.json requirements before installing in an older or very new Laravel app. Confirm compatibility in a staging branch before upgrading production.
- How do I validate an EU VAT number in a Laravel form request?
- Add the package's VAT validation rule to the rules array in your FormRequest or controller validation call. The rule sends the submitted VAT ID to VIES and returns a validation failure when the number is invalid or the service cannot confirm it. Keep the input as a string and normalize country prefixes before validation.
- Does this package check VAT numbers against VIES in real time?
- Yes, the package validates EU VAT numbers against the central ec.europa.eu VIES database. That means validation depends on network access and VIES availability. For critical checkout flows, plan for temporary VIES outages and avoid blocking users without a fallback.
- Can I configure SOAP or REST for the VIES client?
- Yes, the package exposes configurable SOAP and REST clients for VIES. You can choose the transport in the published configuration and adjust client settings such as timeouts. Use the option that fits your infrastructure and test it against VIES in staging.
- How does the package handle VIES timeouts and failures?
- Configure sensible timeouts in the VIES client config and catch exceptions around validation or facade calls. Because VIES is an external service, your app should degrade gracefully when it is slow or unavailable, for example by queuing a recheck or flagging the record for manual review. Do not assume every validation call will succeed.
- Does laravel-vat-eu-validator cache VAT validation results?
- Built-in caching of VIES results is not highlighted in the package overview, so treat each validation as an external call unless your config shows otherwise. For high-volume use, wrap facade calls in Laravel's cache with a short TTL and respect VIES rate limits. Avoid caching invalid results for too long because VAT status can change.
- Is it GDPR compliant to validate and store EU VAT numbers?
- EU VAT numbers can be personal data when linked to sole traders or individuals, so collect them only when needed and document your lawful basis and retention period. The package transmits the VAT number to VIES, which is an external service, so review your privacy notice and data processing agreements. Avoid logging full VAT IDs in plain text unless it is necessary.
- What are the VIES rate limits and production scaling concerns?
- VIES enforces rate limits and can be slow or unavailable, so high-volume validation should be cached, queued, or batched where possible. Do not make a synchronous VIES call on every page load or API request. Monitor failures and provide a fallback path so valid customers are not blocked by third-party downtime.
- What changed in v3.5.0 and is it safe to upgrade from v3.4.x?
- Version 3.5.0 adds AI guidelines for Laravel Boost and a CI drift test to keep those guidelines accurate, with no runtime code changes reported. Upgrading from v3.4.x should be safe for application behavior, but run your test suite and review the changelog. Teams using Laravel Boost can run the Boost install or discover command to ingest the guidelines.