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

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

neptunesoftware/laravel-invoice
===============================

Easy invoice generation using Laravel Eloquent

2.0.3(6y ago)896↓100%2[1 PRs](https://github.com/neptunesoftware/laravel-invoice/pulls)MITPHPPHP ^7.2

Since Jun 21Pushed 4y agoCompare

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

READMEChangelog (4)Dependencies (6)Versions (24)Used By (0)

laravel-invoice
===============

[](#laravel-invoice)

[![PHP Composer](https://github.com/neptunesoftware/laravel-invoice/workflows/PHP%20Composer/badge.svg)](https://github.com/neptunesoftware/laravel-invoice/workflows/PHP%20Composer/badge.svg)[![Latest Version on Packagist](https://camo.githubusercontent.com/388c1b8064a407c5f36e818957175f52b23ebd98c95ed6f21b71b4e315ff4067/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e657074756e65736f6674776172652f6c61726176656c2d696e766f6963652e737667)](https://packagist.org/packages/neptunesoftware/laravel-invoice)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/55b12b77aa7415ea4a26f40d84ab04ead224f4f8f013cb4727ae0df3c03dbbbd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e657074756e65736f6674776172652f6c61726176656c2d696e766f6963652e737667)](https://packagist.org/packages/neptunesoftware/laravel-invoice)[![Code Coverage](https://camo.githubusercontent.com/40d33287b89e89e67af03f82aa52c1481fdbef4790ec961e1a27c79c45a02a3a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6e657074756e65736f6674776172652f6c61726176656c2d696e766f6963652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/neptunesoftware/laravel-invoice/?branch=master)

This package has been changed, updated and redistributed. To utilize original distribution, see [sandervanhooft/laravel-invoicable](https://github.com/sandervanhooft/laravel-invoicable)repository.

**IMPORTANT**

> This fork is going to be maintained by @neptunesoftware and it's not compatible with original repository.

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

What is different?
------------------

[](#what-is-different)

In order to follow changes, see [changelog](CHANGELOG.md) file.

Structure
---------

[](#structure)

```
.
├── config              # Configuration file
├── database            # Database files
│   └── migrations
├── resources           # Resource files
│   └── views
├── src                 # Soruce files
│   ├── Interfaces
│   ├── Models
│   ├── Providers
│   ├── Scopes
│   ├── Services
│   └── Traits
└── tests               # Test files
    ├── Feature
    └── Unit

```

Install
-------

[](#install)

Via Composer

```
$ composer require neptunesoftware/laravel-invoice
```

You can publish the migration with:

```
$ php artisan vendor:publish --provider="NeptuneSoftware\Invoice\Providers\InvoiceServiceProvider" --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 `invoice.php` config file with:

```
$ php artisan vendor:publish --provider="NeptuneSoftware\Invoice\Providers\InvoiceServiceProvider" --tag="config"
```

This is what the default config file looks like:

```
return [
    'default_currency' => 'TRY',
    'default_status' => 'concept',
    'locale' => 'tr_TR',
    'table_names' => [
        'invoices' => 'invoices',
        'invoice_lines' => 'invoice_lines',
    ]
];
```

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

```
$ php artisan vendor:publish --provider="NeptuneSoftware\Invoice\Providers\InvoiceServiceProvider" --tag="views"
```

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

Usage
-----

[](#usage)

**Money figures are in cents!**

Add the HasInvoice trait to the Eloquent model which needs to send or receive invoices (typically a Customer or Company model):

```
use Illuminate\Database\Eloquent\Model;
use NeptuneSoftware\Invoice\Traits\HasInvoice;

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

Now you can create invoices for a customer:

```
$customer = Customer::first();
$product = Product::first(); // Any model to be referenced in an invoice line
$service = $service->create($customer); // Injected dependency

// To add a line to the invoice, use these example parameters:
//  Amount:
//      118 (₺1,18) incl tax
//      100 (₺1,00) excl tax
//  Description: 'Some description'
//  Tax percentage: 0.18 (18%)

# Scenerio 1:
$service->addTaxPercentage('VAT', 0.18)->addAmountInclTax($product, 118, 'Some description');
$service->addTaxPercentage('VAT', 0.18)->addAmountExclTax($product, 100, 'Some description');

# Scenerio 2:
$service->addTaxFixed('VAT', 18)->addAmountInclTax($product, 118, 'Some description');
$service->addTaxFixed('VAT', 18)->addAmountExclTax($product, 100, 'Some description');

# Scenerio 3 for taxes:
$service->addTaxPercentage('VAT', 0.18)->addAmountInclTax($product, 118, 'Some description');
$service->addTaxFixed('VAT', 18)->addAmountExclTax($product, 100, 'Some description');

// Invoice totals are now updated
$invoice = $service->getInvoice();
echo $invoice->total; // 236
echo $invoice->tax; // 36

// Set additional information (optional)
$invoice->currency; // defaults to 'TRY' (see config file)
$invoice->status; // defaults to 'concept' (see config file)
$invoice->receiver_info; // defaul ts 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
$service->lines;
$service->lines();

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

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

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

// Convenience methods
$service->findByReference($reference);
$service->findByReferenceOrFail($reference);
$service->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.

Credits
-------

[](#credits)

- [Burak](https://github.com/ikidnapmyself)
- [Fatih](https://github.com/kablanfatih)
- [Uğur](https://github.com/ugurdnlr)
- [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

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~52 days

Total

16

Last Release

2212d ago

Major Versions

1.1.0 → v2.x-dev2019-09-25

1.2.0 → 2.0.02020-04-08

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

v2.x-devPHP &gt;=7.2

1.2.0PHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/e66fa362edf07a6def5764cf0cd4ab41cd49cb9272085619dfdf308815c934e5?d=identicon)[ikidnapmyself](/maintainers/ikidnapmyself)

---

Top Contributors

[![ikidnapmyself](https://avatars.githubusercontent.com/u/13779866?v=4)](https://github.com/ikidnapmyself "ikidnapmyself (36 commits)")[![sandervanhooft](https://avatars.githubusercontent.com/u/7265703?v=4)](https://github.com/sandervanhooft "sandervanhooft (36 commits)")[![kablanfatih](https://avatars.githubusercontent.com/u/33814925?v=4)](https://github.com/kablanfatih "kablanfatih (26 commits)")[![ugurdnlr](https://avatars.githubusercontent.com/u/50822963?v=4)](https://github.com/ugurdnlr "ugurdnlr (9 commits)")[![PovilasKorop](https://avatars.githubusercontent.com/u/1510147?v=4)](https://github.com/PovilasKorop "PovilasKorop (1 commits)")

---

Tags

accountinginvoicelaravelphplaraveleloquentpaymentsinvoiceinvoicableLaravel Invoiceneptunesoftware

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[sander-van-hooft/laravel-invoicable

Easy invoice generation using Laravel Eloquent

14711.9k](/packages/sander-van-hooft-laravel-invoicable)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[highsolutions/eloquent-sequence

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

121130.3k](/packages/highsolutions-eloquent-sequence)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)

PHPackages © 2026

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