Laravel 12 integration for belghiti/vies-client (Belghiti\Vies).
belghiti/laravel-rest-vies is a Laravel package for laravel 12 integration for belghiti/vies-client (belghiti\vies)..
It currently has 0 GitHub stars and 0 downloads on Packagist (latest version v0.1.2).
Install it with composer require belghiti/laravel-rest-vies.
Discover more Laravel packages by belghiti
or browse all Laravel packages to compare alternatives.
Last updated
Laravel 12 integration for VIES: Service Provider + Facade + Validation Rule + Cache decorator. It wires the core belghiti/vies-client with retry and Laravel Cache.
composer require belghiti/laravel-rest-vies
php artisan vendor:publish --tag=vies-config
config/vies.php
return [
'base_uri' => env('VIES_BASE_URI', 'https://ec.europa.eu/taxation_customs/vies/rest-api'),
'cache_ttl' => (int) env('VIES_CACHE_TTL', 3600),
];
.env
VIES_BASE_URI=https://ec.europa.eu/taxation_customs/vies/rest-api
VIES_CACHE_TTL=3600
use Vies; // Belghiti\Vies\Laravel\ViesFacade alias
use Belghiti\Vies\Dto\CheckVatRequest;
$res = Vies::checkVatNumber(new CheckVatRequest('FR', '40303265045'));
if ($res->valid) {
// ...
}
use Belghiti\Vies\Client\ViesClientInterface;
use Belghiti\Vies\Dto\CheckVatRequest;
public function __construct(private ViesClientInterface $vies) {}
public function __invoke()
{
$status = $vies->checkStatus();
// ...
}
use Belghiti\Vies\Laravel\Rules\ValidVatInVies;
use Illuminate\Support\Facades\Validator;
$validator = Validator::make(
['vat' => '40303265045'],
['vat' => [new ValidVatInVies(app(\Belghiti\Vies\Client\ViesClientInterface::class), 'FR')]]
);
CheckVatRequest covers the contract fields (countryCode, vatNumber, optional trader info)checkVatNumber() responses using your configured Laravel Cache store (TTL from config)composer lint # PSR-12
composer stan # PHPStan level max
vendor/bin/pest -d
MIT