DragonBe/vies, a PHP client for the VIES (VAT Information Exchange System) API. This is a stable, third-party dependency with its own risks (rate limits, API changes, downtime).DragonBe/vies library directly in Laravel (no bundle needed).VatNumber rule in Form Requests or a custom validator class).ConstraintValidatorInterface, ValidatorBuilder, and form components. Direct Laravel integration is not plug-and-play.DragonBe/vies may have breaking changes (last update: 2023-05-08).DragonBe/vies directly or build a custom validator?DragonBe/vies updates?| Component | Symfony Fit | Laravel Fit | Notes |
|---|---|---|---|
| Validation Layer | ✅ Native | ⚠️ Adapt | Symfony’s ConstraintValidator is direct; Laravel needs custom rules. |
| API Client | ✅ Via Bundle | ✅ Direct | DragonBe/vies works in both. |
| Form Integration | ✅ Native | ❌ No | Symfony forms use constraints; Laravel uses Form Requests or manual validation. |
| Service Container | ✅ Native | ⚠️ Adapt | Bundle registers services; Laravel needs manual binding. |
composer require sandwich/vies-bundle
config/bundles.php):
return [
// ...
Sandwich\ViesBundle\ViesBundle::class => ['all' => true],
];
use Sandwich\ViesBundle\Validator\Constraints as ViesAssert;
$builder->add('vatNumber', TextType::class, [
'constraints' => [
new ViesAssert\ValidVatNumber(),
],
]);
src/Validator/ValidVatNumber.php and src/Validator/ValidVatNumberValidator.php.ValidatorInterface → Laravel’s Validator facade).// app/Rules/VatNumber.php
use DragonBe\Vies\Client;
use Illuminate\Contracts\Validation\Rule;
class VatNumber implements Rule {
public function passes($attribute, $value) {
$client = new Client();
return $client->validate($value);
}
public function message() {
return 'The :attribute is invalid.';
}
}
use App\Rules\VatNumber;
public function rules() {
return [
'vat_number' => ['required', new VatNumber],
];
}
Illuminate\Cache) for VIES API calls.DragonBe/vies may need PHP 8.0+ for newer Laravel versions.symfony/validator (only needed if using bundle in Symfony).dragonbe/vies (required in both cases).DragonBe/vies locally for edge cases (e.g., invalid formats, API errors).US123456789 vs. DE123456789).DragonBe/vies) is stable.DragonBe/vies changes.| Task | Symfony Bundle | Laravel Custom | Forked Bundle |
|---|---|---|---|
| Dependency Updates | Low | Medium | High |
| Bug Fixes | Upstream | Self-hosted | Self-hosted |
| Feature Requests | Upstream | Self-hosted | Self-hosted |
DragonBe/vies):
How can I help you explore Laravel packages today?