PHP code example of goldnead / statamic-invoices

1. Go to this page and download the library: Download goldnead/statamic-invoices 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/ */

    

goldnead / statamic-invoices example snippets


// config/invoices.php
'seller' => [
    'name' => 'Adrian Goldner',
    'address' => "Beispielweg 1\n60311 Frankfurt am Main",
    'vat_id' => 'DE123456789',
    'tax_number' => '01/234/56789',
],

'number' => [
    'prefix' => 'RE',
    'period' => 'Y-m',   // monthly. 'Y' yearly, '' never restarts
    'pad' => 3,          // RE2026-08-001
    'prefix_per_brand' => [3 => 'CW', 4 => 'HM'],
],

$invoice->update(['buyer_name' => 'Someone else']);  // RuntimeException
$invoice->delete();                                   // RuntimeException

app(\Goldnead\Invoices\Contracts\PdfRenderer::class)->render($invoice);   // PDF bytes

$this->app->bind(\Goldnead\Invoices\Contracts\PdfRenderer::class, MyRenderer::class);

'delivery' => [
    'enabled' => true,                        // off: the host sends them itself
    'subject' => 'Ihre Rechnung :number',
    'filename' => 'Rechnung-:number.pdf',
],

Route::post('/checkout', CheckoutController::class)
    ->middleware('invoices.business-buyer');

'tax' => [
    'business_only' => ['enabled' => true, '  // off leaves every check "unchecked", so no EU sale gets through
        'service' => 'vies',
        'timeout' => 8,         // past it the check is pending, not invalid
        'cache_hours' => 168,   // only a *confirmed* number is remembered
    ],
    'merchant_vat_id' => env('INVOICES_SELLER_VAT_ID'),  // makes the enquiry a qualified one
],

'oss' => [
    'destination_taxation' => true,
    'shipped_rates' => true,          // off by default: nothing changes until you ask
    'shipped_rates_class' => 'standard',
],
bash
composer vendor:publish --tag=invoices-config
php artisan migrate

php artisan invoices:brand-check
bash
php artisan invoices:export csv --month=2026-08 --output=august.csv
php artisan invoices:export report --quarter=2026-Q3
php artisan invoices:export pdf --year=2025 --output=belege-2025.zip   # or --queue