PHPackages                             soap/laravel-invoices - 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. soap/laravel-invoices

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

soap/laravel-invoices
=====================

Easy invoices generation using Laravel Eloquent

v3.0.1(4y ago)112.5k↓52.1%1MITPHPPHP ^7.3

Since Jun 21Pushed 4y agoCompare

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

READMEChangelog (1)Dependencies (6)Versions (26)Used By (1)

laravel-invoices
================

[](#laravel-invoices)

[![Latest Composer Test](https://github.com/soap/laravel-invoices/actions/workflows/php.yml/badge.svg)](https://github.com/soap/laravel-invoices/actions/workflows/php.yml/badge.svg)[![Build Status](https://camo.githubusercontent.com/36b0d1b41c58ee76b926d1efb8334076b9068af400f18ccd62c755b6a53f8794/68747470733a2f2f6170702e7472617669732d63692e636f6d2f736f61702f6c61726176656c2d696e766f696365732e7376673f6272616e63683d6d6173746572)](https://app.travis-ci.com/soap/laravel-invoices)[![PHP Version Require](https://camo.githubusercontent.com/07cf668ac51fba0bd78b12034d91d10f0a0df8a91054ee96c0224579f748665a/687474703a2f2f706f7365722e707567782e6f72672f736f61702f6c61726176656c2d696e766f696365732f726571756972652f706870)](https://packagist.org/packages/soap/laravel-invoices)[![Latest Stable Version](https://camo.githubusercontent.com/24411e4d2a96606b35cf3c94df7ab7e3e251244efc298ab567565321d1a7df64/687474703a2f2f706f7365722e707567782e6f72672f736f61702f6c61726176656c2d696e766f696365732f76)](https://packagist.org/packages/soap/laravel-invoices)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/a5104fe4b45379cb03885b3130a7f8fad0767707ead6447f66b6841a4aee4177/687474703a2f2f706f7365722e707567782e6f72672f736f61702f6c61726176656c2d696e766f696365732f646f776e6c6f616473)](https://packagist.org/packages/soap/laravel-invoices)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b7c8ed75ee32d9b8cbf76c8fa3182180e03c1ba980c67a31b1e6db0a0b1da9e4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736f61702f6c61726176656c2d696e766f696365732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/soap/laravel-invoices/?branch=master)

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

**IMPORTANT**

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

Easy invoices 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 soap/laravel-invoices
```

You can publish the migration with:

```
$ php artisan vendor:publish --provider="Soap\Invoices\Providers\InvoicesServiceProvider" --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 `invoices.php` config file with:

```
$ php artisan vendor:publish --provider="Soap\Invoices\Providers\InvoicesServiceProvider" --tag="config"
```

This is what the default config file looks like:

```
return [
    'default_currency' => 'THB',
    'default_status' => 'draft',
    'locale' => 'th_TH',
    '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="Soap\Invoices\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 Soap\Invoices\Traits\HasInvoice;

class Order extends Model
{
    use HasInvoices; // 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

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community14

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

Recently: every ~138 days

Total

17

Last Release

1678d ago

Major Versions

1.1.0 → v2.x-dev2019-09-25

1.2.0 → 2.0.02020-04-08

2.0.3 → v3.0.12021-10-14

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

v2.x-devPHP &gt;=7.2

1.2.0PHP ^7.2

v3.0.1PHP ^7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1073690?v=4)[Prasit Gebsaap](/maintainers/soap)[@soap](https://github.com/soap)

---

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)")[![soap](https://avatars.githubusercontent.com/u/1073690?v=4)](https://github.com/soap "soap (21 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

laraveleloquentpaymentsinvoiceslaravel-invoicesinvoicable

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/soap-laravel-invoices/health.svg)

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

###  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)
