PHP code example of alegiac / laravel-vat-checker

1. Go to this page and download the library: Download alegiac/laravel-vat-checker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alegiac / laravel-vat-checker example snippets


use LaravelVatChecker;

$result = LaravelVatChecker::check('IT12345678901');
// $result = [
//   'isFormatted' => bool,
//   'isVies' => bool,
//   'isError' => bool,
//   'errorDescription' => string|null,
//   'details' => array
// ];

use Alegiac\LaravelVatChecker\LaravelVatChecker;

$checker = new LaravelVatChecker();
$result = $checker->check('DE123456789');

$result = LaravelVatChecker::check('GB123456789');
// $result['isFormatted'] === true/false

$result = LaravelVatChecker::check('CHE-421.098.863 MWST');
// $result['isFormatted'] === true/false

$result = LaravelVatChecker::check('NO999888777MVA');
// $result['isFormatted'] === true/false

$result = LaravelVatChecker::check('AU51824753556');
// $result['isFormatted'] === true/false

$result = LaravelVatChecker::check('CA123456789RT0001');
// $result['isFormatted'] === true/false

$result = LaravelVatChecker::check('NZ123456789');
// $result['isFormatted'] === true/false
bash
php artisan vendor:publish --tag=vat-checker-config
php artisan vendor:publish --tag=vat-checker-views