承接 belghiti/laravel-rest-vies 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

belghiti/laravel-rest-vies

最新稳定版本:v0.1.2

Composer 安装命令:

composer require belghiti/laravel-rest-vies

包简介

Laravel 12 integration for belghiti/vies-client (Belghiti\Vies).

README 文档

README

CI Packagist Downloads

Laravel 12 integration for VIES: Service Provider + Facade + Validation Rule + Cache decorator. It wires the core belghiti/vies-client with retry and Laravel Cache.

Requirements

  • Laravel 12.x
  • PHP 8.2 – 8.5

Installation

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

Usage

Facade

use Vies; // Belghiti\Vies\Laravel\ViesFacade alias
use Belghiti\Vies\Dto\CheckVatRequest;

$res = Vies::checkVatNumber(new CheckVatRequest('FR', '40303265045'));
if ($res->valid) {
    // ...
}

Dependency Injection

use Belghiti\Vies\Client\ViesClientInterface;
use Belghiti\Vies\Dto\CheckVatRequest;

public function __construct(private ViesClientInterface $vies) {}

public function __invoke()
{
    $status = $vies->checkStatus();
    // ...
}

Validation Rule

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')]]
);

Notes

  • CheckVatRequest covers the contract fields (countryCode, vatNumber, optional trader info)
  • The package caches checkVatNumber() responses using your configured Laravel Cache store (TTL from config)

Quality

composer lint   # PSR-12
composer stan   # PHPStan level max
vendor/bin/pest -d

License

MIT

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固