Search by

pushery / tax-audit-export-for-laravel

pushery

Writes the index.xml, DTD and CSV files of a tax audit data export (GoBD, GDPdU, DSFinV-K) from table definitions, with a reader and a test helper.

v0.1.0 2026-11-21 00:34 UTC

This package is auto-updated.

Last update: 2026-11-21 00:42:06 UTC


README

Tax Audit Export for Laravel

Tax Audit Export for Laravel

Latest Version PHP Version Laravel Versions License

Tests: Pest 5 Coverage: 100% Type coverage: 100% PHPStan: level 10 Code style: Pint

Writes the index.xml, DTD and CSV files of a tax audit data export (GoBD, GDPdU, DSFinV-K) from table definitions, with a reader and a test helper.

Documentation

Full documentation at docs.pushery.com/tax-audit-export-for-laravel. This README is the quick start; the guides and the configuration reference live there.

Requirements

  • PHP 8.4+ with the dom, libxml and mbstring extensions, which a standard PHP build carries
  • Laravel 13+

The package keeps no table and needs no database: it writes files from the rows your application hands it.

Tested on the floor of the declared PHP range, because a >= promise is only proven by running on the boundary, and on the minor version above it, so the range above the floor is exercised here rather than first by a consumer.

Installation

composer require pushery/tax-audit-export-for-laravel

The service provider is registered automatically through package discovery.

Configuration

Publish the configuration file:

php artisan vendor:publish --tag=tax-audit-export-config

This writes config/tax-audit-export.php, where every option is documented inline. An export started from Pushery\TaxAuditExport\ExportSettings names the data supplier that TAX_AUDIT_EXPORT_SUPPLIER_NAME, TAX_AUDIT_EXPORT_SUPPLIER_LOCATION and TAX_AUDIT_EXPORT_SUPPLIER_COMMENT set. An export built with a DataSupplier of its own names that one and reads none of them. The package ships no migrations, routes or views.

Usage

Describe each table with its file, its name, a description and its columns; the first column is the key. Then start the export from the settings, so that it names the configured data supplier, and write it into a directory of its own:

use Pushery\TaxAuditExport\Column;
use Pushery\TaxAuditExport\ExportSettings;
use Pushery\TaxAuditExport\Table;

$invoices = new Table('invoices.csv', 'Invoices', 'The invoices of the period', [
    Column::text('invoice_number', 'Number of the invoice', 30),
    Column::numeric('gross_amount', 'Gross amount in euros', 2),
]);

app(ExportSettings::class)->export()
    ->add($invoices, [
        ['invoice_number' => 'I-1', 'gross_amount' => '99.90'],
    ])
    ->writeTo(storage_path('app/tax-audit/2025'));

The directory then holds invoices.csv, the index.xml after the description standard of the GoBD, and the document type definition gdpdu-01-09-2004.dtd, byte for byte as the BZSt publishes it. Pushery\TaxAuditExport\Reader opens an export through its index.xml alone, and Pushery\TaxAuditExport\Testing\IndexValidator checks an index.xml against the definition in a test. The documentation covers columns and types, the format of the files, links between tables and the limits of the reader.

Testing

The test suite is not part of the published package: the tests and their PHPUnit configuration stay in the development repository, so a clone of this repository has no composer test. CONTRIBUTING.md says how a change is tested on its way in.

Security

Please review the security policy and report vulnerabilities privately rather than opening a public issue.

Built by Pushery

This package is built and maintained by Pushery — a Berlin-based studio building Laravel applications, SaaS products, and open-source tools.

Building a Laravel UI? WireKit is Pushery's open-source Livewire component kit. Browse the rest of our work at pushery.com.

License

The MIT License (MIT). See LICENSE for details.