oefenweb/cakephp-vat-number-check

A VAT number check Plugin for CakePHP

v3.0.2 2020-04-30 23:16 UTC

This package is auto-updated.

Last update: 2024-04-29 02:30:03 UTC


README

Build Status PHP 7 ready Coverage Status Packagist downloads Code Climate Scrutinizer Code Quality

Requirements

  • CakePHP 2.9.0 or greater.
  • PHP 7.0.0 or greater.

Installation

Clone/Copy the files in this directory into app/Plugin/VatNumberCheck

Configuration

Ensure the plugin is loaded in app/Config/bootstrap.php by calling:

CakePlugin::load('VatNumberCheck', ['routes' => true]);

Usage

Model

Normalizes a VAT number:

$vatNumber = $this->VatNumberCheck->normalize($vatNumber);

Checks a given VAT number:

$vatNumberValid = $this->VatNumberCheck->check($vatNumber);

Helper

Generates a VAT number check form field:

echo $this->VatNumberCheck->input('vat_number', ['label' => __('VAT number')]);