PHPackages                             aabosham/laravel-invoicable - 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. [Database &amp; ORM](/categories/database)
4. /
5. aabosham/laravel-invoicable

ActiveLibrary[Database &amp; ORM](/categories/database)

aabosham/laravel-invoicable
===========================

Easy invoice generation using Laravel Eloquent

1.4.2(2y ago)042MITPHPPHP ^7.4 || ^8.0 || ^9.0

Since Jun 21Pushed 2y agoCompare

[ Source](https://github.com/AAbosham/laravel-invoicable)[ Packagist](https://packagist.org/packages/aabosham/laravel-invoicable)[ Docs](https://github.com/SanderVanHooft/laravel-invoicable)[ RSS](/packages/aabosham-laravel-invoicable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (17)Used By (0)

laravel-invoicable
==================

[](#laravel-invoicable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1ace5083757e75842a332ec00f1add5ec191c107c3d7a7b0e7571101aed9c875/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616e6465722d76616e2d686f6f66742f6c61726176656c2d696e766f696361626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sander-van-hooft/laravel-invoicable)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Github Actions](https://github.com/sandervanhooft/laravel-invoicable/workflows/tests/badge.svg)](https://github.com/sandervanhooft/laravel-invoicable/actions)[![Total Downloads](https://camo.githubusercontent.com/c58b6c209e15b8b220b69aa15a0ed5edf885db2ac4ce448d7a7e0ce5ed72bf1e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616e6465722d76616e2d686f6f66742f6c61726176656c2d696e766f696361626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sander-van-hooft/laravel-invoicable)

Easy invoice creation for Laravel. Unlike Laravel Cashier, this package is payment gateway agnostic.

If you're looking for Mollie payment processing, be sure to check out [laravel-payable-redirect-mollie](https://github.com/sandervanhooft/laravel-payable-redirect-mollie).

Structure
---------

[](#structure)

```
database/
resources
src/
tests/
vendor/

```

Install
-------

[](#install)

Via Composer

```
$ composer require sander-van-hooft/laravel-invoicable
```

You can publish the migration with:

```
$ php artisan vendor:publish --provider="SanderVanHooft\Invoicable\InvoicableServiceProvider" --tag="migrations"
```

After the migration has been published you can create the invoices and invoice\_lines tables by running the migrations:

```
$ php artisan migrate
```

Optionally, you can also publish the `invoicable.php` config file with:

```
$ php artisan vendor:publish --provider="SanderVanHooft\Invoicable\InvoicableServiceProvider" --tag="config"
```

This is what the default config file looks like:

```
return [
    'default_currency' => 'EUR',
    'default_status' => 'concept',
    'locale' => 'nl_NL',
];
```

If you'd like to override the design of the invoice blade view and pdf, publish the view:

```
$ php artisan vendor:publish --provider="SanderVanHooft\Invoicable\InvoicableServiceProvider" --tag="views"
```

You can now edit `receipt.blade.php` in `/resources/views/invoicable/receipt.blade.php` to match your style.

Usage
-----

[](#usage)

**Money figures are in cents!**

Add the invoicable trait to the Eloquent model which needs to be invoiced (typically an Order model):

```
use Illuminate\Database\Eloquent\Model;
use SanderVanHooft\Invoicable\IsInvoicable\IsInvoicableTrait;

class Order extends Model
{
    use IsInvoicableTrait; // enables the ->invoices() Eloquent relationship
}
```

Now you can create invoices for an Order:

```
$order = Order::first();
$invoice = $order->invoices()->create([]);

// To add a line to the invoice, use these example parameters:
//  Amount:
//      121 (€1,21) incl tax
//      100 (€1,00) excl tax
//  Description: 'Some description'
//  Tax percentage: 0.21 (21%)
$invoice = $invoice->addAmountInclTax(121, 'Some description', 0.21);
$invoice = $invoice->addAmountExclTax(100, 'Some description', 0.21);

// Invoice totals are now updated
echo $invoice->total; // 242
echo $invoice->tax; // 42

// Set additional information (optional)
$invoice->currency; // defaults to 'EUR' (see config file)
$invoice->status; // defaults to 'concept' (see config file)
$invoice->receiver_info; // defaults to null
$invoice->sender_info; // defaults to null
$invoice->payment_info; // defaults to null
$invoice->note; // defaults to null

// access individual invoice lines using Eloquent relationship
$invoice->lines;
$invoice->lines();

// Access as pdf
$invoice->download(); // download as pdf (returns http response)
$invoice->pdf(); // or just grab the pdf (raw bytes)

// Handling discounts
// By adding a line with a negative amount.
$invoice = $invoice->addAmountInclTax(-121, 'A nice discount', 0.21);

// Or by applying the discount and discribing the discount manually
$invoice = $invoice->addAmountInclTax(121 * (1 - 0.30), 'Product XYZ incl 30% discount', 0.21);

// Convenience methods
Invoice::findByReference($reference);
Invoice::findByReferenceOrFail($reference);
$invoice->invoicable() // Access the related model
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Sander van Hooft](https://github.com/sandervanhooft)
- [All Contributors](../../contributors)
- Inspired by [Laravel Cashier](https://github.com/laravel/cashier)'s invoices.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity89

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 83.7% 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 ~149 days

Recently: every ~351 days

Total

16

Last Release

1016d ago

Major Versions

1.1.0 → v2.x-dev2019-09-25

PHP version history (6 changes)1.0.0PHP ~5.6|~7.0

v2.x-devPHP &gt;=7.2

1.2.0PHP ^7.2

1.4.0PHP ^7.4 || ^8.0

1.4.1PHP ^7.4 || ^8.0 || ^9.

1.4.2PHP ^7.4 || ^8.0 || ^9.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/67c34ab5836206d1896bdac1432480b1e9ba7225e9e2adfb44b821b472c59e1c?d=identicon)[AAbosham](/maintainers/AAbosham)

---

Top Contributors

[![sandervanhooft](https://avatars.githubusercontent.com/u/7265703?v=4)](https://github.com/sandervanhooft "sandervanhooft (36 commits)")[![AAbosham](https://avatars.githubusercontent.com/u/12083600?v=4)](https://github.com/AAbosham "AAbosham (3 commits)")[![ciungulete](https://avatars.githubusercontent.com/u/742128?v=4)](https://github.com/ciungulete "ciungulete (2 commits)")[![PovilasKorop](https://avatars.githubusercontent.com/u/1510147?v=4)](https://github.com/PovilasKorop "PovilasKorop (1 commits)")[![timwassenburg](https://avatars.githubusercontent.com/u/75377381?v=4)](https://github.com/timwassenburg "timwassenburg (1 commits)")

---

Tags

laraveleloquentpaymentsinvoiceinvoicableSanderVanHooftlaravel-invoicable

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/aabosham-laravel-invoicable/health.svg)

```
[![Health](https://phpackages.com/badges/aabosham-laravel-invoicable/health.svg)](https://phpackages.com/packages/aabosham-laravel-invoicable)
```

###  Alternatives

[sander-van-hooft/laravel-invoicable

Easy invoice generation using Laravel Eloquent

14711.9k](/packages/sander-van-hooft-laravel-invoicable)[pawelmysior/laravel-publishable

Toggle the published state of your Eloquent models easily

2219.1k3](/packages/pawelmysior-laravel-publishable)

PHPackages © 2026

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