1. Go to this page and download the library: Download invoiceninja/einvoice 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/ */
invoiceninja / einvoice example snippets
use InvoiceNinja\EInvoice\EInvoice;
use InvoiceNinja\EInvoice\Validation\Profiles\InvoiceSettingsProfile;
use InvoiceNinja\EInvoice\Validation\ValidationGroups;
$errors = (new EInvoice())->validatePayload(
$payload['Invoice'], // inner document, without the e_invoice / Invoice wrappers
InvoiceSettingsProfile::class,
[ValidationGroups::INVOICE_SETTINGS],
);
foreach ($errors as $error) {
// Paths are relative to the inner document, e.g. ProjectReference[1].ID.value.
$path = $error->getPropertyPath();
$message = $error->getMessage();
$code = $error->getCode();
}