PHPackages                             bkfdev/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. bkfdev/invoicable

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

bkfdev/invoicable
=================

Easy invoice generation using Laravel Eloquent

v1.1.8(2y ago)045MITPHP

Since Dec 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/aeq-dev/invoicable)[ Packagist](https://packagist.org/packages/bkfdev/invoicable)[ Docs](https://github.com/aeq-dev/invoicable)[ RSS](/packages/bkfdev-invoicable/feed)WikiDiscussions main Synced today

READMEChangelog (10)DependenciesVersions (20)Used By (0)

laravel Invoicable
==================

[](#laravel-invoicable)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

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

Structure
---------

[](#structure)

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

```

Install
-------

[](#install)

Via Composer

```
composer require bkfdev/invoicable
```

Next, you must install the service provider if you work with Laravel 5.4:

```
// config/app.php
'providers' => [
    ...
    Bkfdev\Invoicable\InvoicableServiceProvider::class,
];
```

You can publish the migration with:

```
php artisan vendor:publish --provider="Bkfdev\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="Bkfdev\Invoicable\InvoicableServiceProvider" --tag="config"
```

This is what the default config file looks like:

```
return [
    'invoice_number' => 'INV#' . date('M-y') . '-',
    'payment_number' => 'PAY#' . date('M-y') . '-',
];
```

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

```
php artisan vendor:publish --provider="Bkfdev\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 Bkfdev\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)

- [Abdelkader Boukhelf](https://github.com/aeq-dev)
- [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

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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 ~3 days

Recently: every ~13 days

Total

19

Last Release

871d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d2469c45f2a6b752194eb41838268b9d199232d364f18be8597cd3c1da9c5e7?d=identicon)[aeq-dev](/maintainers/aeq-dev)

---

Top Contributors

[![aeq-dev](https://avatars.githubusercontent.com/u/81385994?v=4)](https://github.com/aeq-dev "aeq-dev (25 commits)")

---

Tags

laraveleloquentpaymentsinvoiceinvoicablelaravel-invoicablebkfdev

### Embed Badge

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

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

###  Alternatives

[sander-van-hooft/laravel-invoicable

Easy invoice generation using Laravel Eloquent

14712.1k](/packages/sander-van-hooft-laravel-invoicable)[rtconner/laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

400396.7k5](/packages/rtconner-laravel-likeable)[highsolutions/eloquent-sequence

A Laravel package for easy creation and management sequence support for Eloquent models with elastic configuration.

121137.5k](/packages/highsolutions-eloquent-sequence)[cybercog/laravel-nova-ban

A Laravel Nova banning functionality for your application.

42205.7k](/packages/cybercog-laravel-nova-ban)[phaza/single-table-inheritance

Single Table Inheritance Trait

1515.8k](/packages/phaza-single-table-inheritance)

PHPackages © 2026

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