1. Go to this page and download the library: Download schenke-io/laravel-invoice 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/ */
schenke-io / laravel-invoice example snippets
$price = Currency::fromAny("1.234,56 €"); // EU format detected
$vat = new Vat(0.19);
$net = $price->fromGrossToNet($vat);
use SchenkeIo\Invoice\Money\Currency;
// Create from various formats
$price = Currency::fromFloat(19.99);
$price2 = Currency::fromAny('12,50 €'); // EU format
$price3 = Currency::fromAny('1,234.56'); // US format
$negative = Currency::fromAny('-10,00'); // Negative value
// Arithmetic
$total = $price->plus($price2); // 32.49 €
$discounted = $total->times(0.9); // 10% discount
echo $discounted->str(); // "29,24 €"
use SchenkeIo\Invoice\Invoicing\InvoiceNumeric;
use SchenkeIo\Invoice\Invoicing\Customer;
use SchenkeIo\Invoice\Invoicing\LineData;
use SchenkeIo\Invoice\Enum\InvoiceLineType;
use Carbon\Carbon;
$customer = new Customer('Jane Doe', 'Main Street 1', '12345', 'Berlin', 'DE');
$invoice = new InvoiceNumeric('INV-2023-001', Carbon::now(), $customer);
// Add items (Gross price automatically calculates Net based on type)
$invoice->addLine(LineData::fromTotalGrossPrice(
'Web Design Service',
119.00,
InvoiceLineType::SalesDE
));
// Get HTML table for the invoice
$view = $invoice->invoiceTableView(isGrossInvoice: true);
// Access header/body/footer specifically if needed
$header = $view->header;
$body = $view->body;
$footer = $view->footer;
echo $view->html();
use SchenkeIo\Invoice\Invoicing\InvoiceNumeric;
use SchenkeIo\Invoice\Invoicing\LineData;
use SchenkeIo\Invoice\Enum\InvoiceLineType;
$invoice = new InvoiceNumeric('INV-002', Carbon::now(), $customer);
// Standard VAT (19% for DE)
$invoice->addLine(LineData::fromTotalNetPrice('Laptop', 1000.00, InvoiceLineType::SalesDE));
// Reduced VAT (7% for DE)
$invoice->addLine(LineData::fromTotalGrossPrice('Technical Book', 10.70, InvoiceLineType::SaleBooksDE));
// Non-taxable deposit
$invoice->addLine(LineData::fromTotalGrossPrice('Security Deposit', 500.00, InvoiceLineType::Deposit));
// The generated HTML will
use SchenkeIo\Invoice\Invoicing\LineData;
use SchenkeIo\Invoice\Enum\InvoiceLineType;
// Austrian Invoice (20% Standard VAT)
$lineAT = LineData::fromTotalNetPrice(
'Consulting',
100.00,
InvoiceLineType::SalesDE, // Base type
'AT' // Country code
);
// French Invoice (20% Standard VAT)
$lineFR = LineData::fromTotalNetPrice(
'Service',
100.00,
InvoiceLineType::SalesDE,
'FR'
);
use SchenkeIo\Invoice\Banking\SepaCode;
$sepa = SepaCode::fromInvoice(
$invoice,
'Schenke Io',
'DE12345678901234567890',
'Invoice',
'ABCDEFGH' // optional BIC
);
// Get a Data URI for an <img> tag
echo '<img src="' . $sepa->dataUri() . '" />';
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.