antalaron/vat-number-validator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

antalaron/vat-number-validator

最新稳定版本:v1.2.1

Composer 安装命令:

composer require antalaron/vat-number-validator

包简介

PHP library to validate VAT numbers

README 文档

README

Build Status Coverage Status Latest Stable Version Latest Unstable Version License

PHP library to validate VAT numbers.

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this library:

$ composer require antalaron/vat-number-validator

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Basic usage

To validate a VAT number:

use Antalaron\Component\VatNumberValidator\VatNumber; use Symfony\Component\Validator\Validation; $validator = Validation::createValidator(); $violations = $validator->validate('ATU37675002', new VatNumber()); if (0 !== count($violations)) { foreach ($violations as $violation) { echo $violation->getMessage().'<br>'; } }

You can add your own VAT validator via extraVat option:

$violations = $validator->validate('11', new VatNumber(['extraVat' => function ($number) { return 0 !== preg_match('/^(\d{2})$/', $number); }]));

Origin

This library is the PHP rewrite of original JavaScript library by Braemoor Software Freebies. Original contributors are found here.

License

This library is under MIT License.

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固