Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Evatr Laravel Package

amondi-media/laravel-evatr

Laravel package to validate German and EU VAT IDs via the official German Federal Central Tax Office (eVatR) online service. Provides a validation rule and rule extension, configurable requester VAT ID, API URL, and timeout.

View on GitHub
Deep Wiki
Context7

VAT Validator

Laravel package for validating German and EU VAT identification numbers using the official German Federal Central Tax Office (Bundeszentralamt für Steuern) online service

Requirements

  • PHP 8.1 or higher
  • Laravel 10.x, 11.x or 12.x
  • Guzzle HTTP Client

Installation

You can install the package via composer:

composer require AmondiMedia/laravel-evatr

The package will automatically register its service provider.

Usage

Validation Rule

You can use the VAT validation rule in your validation rules:

use AmondiMedia\VatValidator\Rules\ValidVatNumber;

$rules = [
    'vat_number' => ['required', new ValidVatNumber()],
];

Using the Validation Rule Extension

You can also use the validation rule extension:

$rules = [
    'vat_number' => ['required', 'valid_vat_number'],
];

The validation rule extension also supports validating country code and VAT number separately:

$rules = [
    'country_code' => ['required', 'string', 'size:2'],
    'vat_number' => ['required', 'valid_vat_number:country_code,vat_number'],
];

Configuration

The package uses the German eVatR service by default. You can publish the configuration file:

php artisan vendor:publish --provider="AmondiMedia\VatValidator\Providers\VatValidatorServiceProvider"

This will create a vat_validator.php file in your config directory.

Environment Configuration

Add the following variable to your .env file:

EVATR_REQUESTER_VAT_ID=DE123456789
  • EVATR_REQUESTER_VAT_ID: Your German VAT identification number (Umsatzsteuer-Identifikationsnummer) that will be used as the requester in the eVatR API calls.

The package also includes these default configurations:

License

GNU General Public License. Please see License File for more information.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony