PHPackages                             schenke-io/laravel-invoice - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. schenke-io/laravel-invoice

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

schenke-io/laravel-invoice
==========================

A robust and flexible PHP package for Laravel that simplifies invoice management, currency handling, and complex VAT calculations.

v0.4.3(1mo ago)0136↓86.7%1MITPHPPHP ^8.3CI passing

Since Sep 9Pushed 1mo agoCompare

[ Source](https://github.com/schenke-io/laravel-invoice)[ Packagist](https://packagist.org/packages/schenke-io/laravel-invoice)[ RSS](/packages/schenke-io-laravel-invoice/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (54)Versions (41)Used By (1)

[![Coverage](workbench/resources/md/svg/coverage.svg)](workbench/resources/md/svg/coverage.svg)[![PHPStan](workbench/resources/md/svg/phpstan.svg)](workbench/resources/md/svg/phpstan.svg)[![Version](https://camo.githubusercontent.com/033236d5afc59254bbb5b927cd044f01cdb8d51405f315c796f2d380a5afd4c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736368656e6b652d696f2f6c61726176656c2d696e766f6963653f7374796c653d666c6174)](https://packagist.org/packages/schenke-io/laravel-invoice)[![Downloads](https://camo.githubusercontent.com/5e5fadd2e3975af2c37ee6c2b1fd3abb5aa4feab94a86441a9e40b155a2d5bc0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736368656e6b652d696f2f6c61726176656c2d696e766f6963653f7374796c653d666c6174)](https://packagist.org/packages/schenke-io/laravel-invoice)[![Tests](https://github.com/schenke-io/laravel-invoice/actions/workflows/run-tests.yml/badge.svg)](https://github.com/schenke-io/laravel-invoice/actions/workflows/run-tests.yml)[![License](https://camo.githubusercontent.com/e8bdbabba35463388e768623202a0c4a71628cc81bfe06282244498cbbba3aa2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f736368656e6b652d696f2f6c61726176656c2d696e766f6963653f7374796c653d666c6174)](https://github.com/schenke-io/laravel-invoice/blob/main/LICENSE.md)[![PHP](https://camo.githubusercontent.com/b8f9059c0cc817d1cebd3d4d040fd80b39e06510697062658bd3949e35ff604a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736368656e6b652d696f2f6c61726176656c2d696e766f6963653f7374796c653d666c6174)](https://packagist.org/packages/schenke-io/laravel-invoice)

Laravel Invoice
==========================================================

[](#laravel-invoice)

> A robust and flexible PHP package for Laravel that simplifies invoice management, currency handling, and complex VAT calculations.

[![cover](workbench/resources/md/cover.png)](workbench/resources/md/cover.png)

### Key Benefits

[](#key-benefits)

- **Precise Financial Calculations**: Uses cent-based integer arithmetic via the `Currency` value object, eliminating common floating-point precision errors in financial data.
- **Automated VAT Logic**: Built-in support for VAT rules across multiple countries (including DE, AT, FR, CH, and more) with a hierarchical system of `InvoiceLineType`, `VatCategory`, and `VatRate`.
- **Flexible Rendering**: Generate clean HTML invoice tables out of the box, with full support for custom Blade templates when you need a personalized look.
- **SEPA Integration**: Easily generate SEPA-compliant QR codes (BezahlCode) to facilitate faster and more accurate payments.
- **Developer Friendly**: 100% test coverage, strict typing, and comprehensive documentation ensure a reliable and maintainable integration into your Laravel projects.
- **Eloquent Integration**: Custom casts for `Currency` make it easy to work with monetary values directly in your models.

### Core Components

[](#core-components)

#### Currency Value Object

[](#currency-value-object)

The `Currency` class (`src/Money/Currency.php`) is the heart of all monetary operations. It stores values as integers (cents) and provides a rich set of methods for:

- **Parsing**: Use `Currency::fromAny($value)` to handle strings, floats, integers, and even other `Currency` instances. It automatically detects EU/US decimal formats.
- **VAT Conversions**:
    - `vatFromGross(Vat $vat)`: Extract VAT amount from a gross total.
    - `vatFromNet(Vat $vat)`: Calculate VAT amount from a net total.
    - `fromGrossToNet(Vat $vat)`: Calculate net price from gross.
    - `fromNetToGross(Vat $vat)`: Calculate gross price from net.
- **Arithmetic**: Precise `plus()`, `minus()`, and `times()` operations that maintain integer integrity.

Example:

```
$price = Currency::fromAny("1.234,56 €"); // EU format detected
$vat = new Vat(0.19);
$net = $price->fromGrossToNet($vat);
```

#### InvoiceNumeric

[](#invoicenumeric)

`InvoiceNumeric` (`src/Invoicing/InvoiceNumeric.php`) orchestrates the creation of an invoice. Its main responsibilities include:

- Managing invoice metadata (ID, Date, Customer).
- Collecting invoice lines (`addLine()`).
- Tracking total weights (`addWeight()`).
- Generating structured view data for rendering via `invoiceTableView()`.
- Providing a default rendering of the invoice header, body, and footer with automated VAT summaries.

Usage Examples
========================================================

[](#usage-examples)

Here are some examples of how to use the `laravel-invoice` package, ranging from basic currency operations to complex multi-tax invoices.

### 1. Basic Currency Operations

[](#1-basic-currency-operations)

The `Currency` class ensures precision by using cents internally.

```
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 €"
```

### 2. Simple Invoice Generation

[](#2-simple-invoice-generation)

Creating a basic invoice with a single tax rate.

```
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();
```

### 3. Complex Multi-Tax Invoice

[](#3-complex-multi-tax-invoice)

Invoices can contain items with different tax categories. The package automatically groups them in the summary.

```
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 include a detailed tax breakdown section
echo $invoice->invoiceTableView(false)->html();
```

### 4. Multi-Country Support

[](#4-multi-country-support)

The package supports VAT rates for various countries. You can specify the country code when adding lines.

```
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'
);
```

### 5. SEPA QR Code Integration

[](#5-sepa-qr-code-integration)

Generate a SEPA-compliant QR code for easy payments.

```
use SchenkeIo\Invoice\Banking\SepaCode;

$sepa = SepaCode::fromInvoice(
    $invoice,
    'Schenke Io',
    'DE12345678901234567890',
    'Invoice',
    'ABCDEFGH' // optional BIC
);

// Get a Data URI for an  tag
echo '';
```

### Currency

[](#currency)

Value object representing a monetary currency.

#### Public methods of Currency

[](#public-methods-of-currency)

methodsummaryfromAnystatic constructor from any valuefromFloatstatic constructor from a float valuefromCentsstatic constructor from centsvatFromGrossVAT amount from the gross price, given a VAT rate.vatFromNetCalculate the VAT amount from the net price, given a VAT rate.fromGrossToNetconvert a gross value to a net value using VATfromNetToGrossConvert a net value to a gross value using VATtoFloatexports to floatstrexports to formatted currency stringplusadds two objectsminussubtracts two objectstimesmultiplies the object by a factortoLivewireexports to Livewire format (numeric scalar)fromLivewire-isEmptyCheck if the object is empty (zero)### Vat

[](#vat)

Represents a Value Added Tax (VAT) rate and provides factory methods for countries.

#### Public methods of Vat

[](#public-methods-of-vat)

methodsummarycountryGet a country instance by its ISO code.fromIdCreate a VAT instance from a numeric ID (e.g. '190' for 19.0%).fromRateCreate a VAT instance from a float rate (e.g. 0.19 for 19%).### VatCategory

[](#vatcategory)

Defines the high-level tax categories based on the analysis from

#### Public methods of VatCategory

[](#public-methods-of-vatcategory)

methodsummarydescriptionGerman description of the category.vatRate-hasVatChecks if this transaction case involves VAT.isReverseChargeChecks if this transaction case is a reverse charge case.cases-from-tryFrom-### InvoiceNumeric

[](#invoicenumeric-1)

Main class for managing invoice data and calculations.

#### Public methods of InvoiceNumeric

[](#public-methods-of-invoicenumeric)

methodsummarygetTotalGrossPriceGet the total gross price of the invoice.getTotalNetPriceGet the total net price of the invoice.addWeighttake the weight in grams and add it to the total weightaddLineadd the lines with automatic positionspayMeshow pay me informationisEmptythe total is zeroinvoiceTableViewPrepare data for a Blade template or raw HTML rendering.### Customer

[](#customer)

Data transfer object for customer information.

### LineData

[](#linedata)

Representation of a single line item on an invoice.

#### Public methods of LineData

[](#public-methods-of-linedata)

methodsummaryfromTotalGrossPriceCreate a line item from its total gross price.fromTotalNetPriceCreate a line item from its total net price.### InvoiceLineType

[](#invoicelinetype)

Enum defining the various types of line items that can appear on an invoice.

#### Public methods of InvoiceLineType

[](#public-methods-of-invoicelinetype)

methodsummaryvatCategoryReturns the tax category.vatRateReturns the applicable VAT rate type.cases-from-tryFrom-### InvoiceTableView

[](#invoicetableview)

Data transfer object for the complete invoice table view.

### LineViewBase

[](#lineviewbase)

Base class for rendering invoice lines as HTML.

#### Public methods of LineViewBase

[](#public-methods-of-lineviewbase)

methodsummaryhtmlGenerate the HTML for a single invoice line row.### SepaCode

[](#sepacode)

Generator for SEPA QR codes (BezahlCode).

#### Public methods of SepaCode

[](#public-methods-of-sepacode)

methodsummaryfromInvoiceCreate a SEPA code instance directly from an invoice.dataUriGenerate the QR code as a PNG data URI.Custom invoice
========================================================

[](#custom-invoice)

To build a custom invoice you first generate a class which extends `LineViewBase` and implements `LineViewInterface`.

This class should define the column-alignment in the `columns()` method.

Then you start a new instance of `InvoiceTableView` and fill its public data. The `columns()` method must return keys that correspond to the public properties of your custom line view class.

### CSS Styling

[](#css-styling)

The rendering engine uses a configuration-based approach for CSS classes. You can customize the look of your tables by providing a config array to the `html()` method or by using the default configuration in `TableView`.

#### Row Classes

[](#row-classes)

The following keys in the configuration control row-level styling:

- `invoice-row-thead`: Classes for the `` row.
- `invoice-row-tbody`: Classes for rows within ``.
- `invoice-row-tfoot`: Classes for rows within ``.
- `invoice-row-empty`: Classes for empty/spacer rows.
- `invoice-row-{LineType}`: Classes specifically for rows of a certain `InvoiceLineType` (e.g., `invoice-row-SalesDE`).

#### Cell Classes

[](#cell-classes)

The following keys control cell-level alignment and emphasis:

- `invoice-cell-left`: Classes for left-aligned cells (default: `cell-left`).
- `invoice-cell-right`: Classes for right-aligned cells (default: `cell-right`).
- `invoice-cell-bold`: Classes for cells that should be bold (default: `cell-bold`).

---

Markdown file generated by [schenke-io/packaging-tools](https://github.com/schenke-io/packaging-tools)

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance92

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

40

Last Release

38d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/111449674?v=4)[Kay-Uwe Schenke](/maintainers/schenke-io)[@schenke-io](https://github.com/schenke-io)

---

Top Contributors

[![schenke-io](https://avatars.githubusercontent.com/u/111449674?v=4)](https://github.com/schenke-io "schenke-io (51 commits)")

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/schenke-io-laravel-invoice/health.svg)

```
[![Health](https://phpackages.com/badges/schenke-io-laravel-invoice/health.svg)](https://phpackages.com/packages/schenke-io-laravel-invoice)
```

###  Alternatives

[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

725172.4k14](/packages/tallstackui-tallstackui)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
