PHPackages                             jhosagid/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. [Payment Processing](/categories/payments)
4. /
5. jhosagid/laravel-invoices

ActiveLibrary[Payment Processing](/categories/payments)

jhosagid/laravel-invoices
=========================

Missing invoices for Laravel

v1.0.4(1y ago)017GPL-3.0-onlyBladePHP &gt;=8.2

Since Nov 4Pushed 1y agoCompare

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

READMEChangelog (5)Dependencies (5)Versions (6)Used By (0)

[![![Banner]](https://camo.githubusercontent.com/b7e5654a97b7100179e0cefa01dd8766049241e853fd77933de075fea1c8fb80/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c253230496e766f696365732e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6a686f73616769642532466c61726176656c2d696e766f69636573267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d504446732b6d6164652b65617379266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d646f63756d656e742d646f776e6c6f6164)](https://camo.githubusercontent.com/b7e5654a97b7100179e0cefa01dd8766049241e853fd77933de075fea1c8fb80/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c253230496e766f696365732e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6a686f73616769642532466c61726176656c2d696e766f69636573267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d504446732b6d6164652b65617379266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d646f63756d656e742d646f776e6c6f6164)

Laravel Invoices
================

[](#laravel-invoices)

[![Latest Stable Version](https://camo.githubusercontent.com/2651bb706d51bda92b456d60a5549be4dc4bb619dafad8dd31a7b180fa1bec60/68747470733a2f2f706f7365722e707567782e6f72672f6a686f73616769642f6c61726176656c2d696e766f696365732f762f737461626c653f32)](https://packagist.org/packages/jhosagid/laravel-invoices)[![Total Downloads](https://camo.githubusercontent.com/f44037c41e36d04d42878549538c84877400650aa07bcbe4ceadf62596edfeee/68747470733a2f2f706f7365722e707567782e6f72672f6a686f73616769642f6c61726176656c2d696e766f696365732f646f776e6c6f6164733f32)](https://packagist.org/packages/jhosagid/laravel-invoices)[![Latest Unstable Version](https://camo.githubusercontent.com/3c3d084afd23007a26791261e931055b535ecbb24bb72ee9222130eb4967c053/68747470733a2f2f706f7365722e707567782e6f72672f6a686f73616769642f6c61726176656c2d696e766f696365732f762f756e737461626c65)](https://packagist.org/packages/jhosagid/laravel-invoices)[![License](https://camo.githubusercontent.com/53df4c70f7e146963a423eba33eacca84a92c7d9ce998868b69e76b36f2bda46/68747470733a2f2f706f7365722e707567782e6f72672f6a686f73616769642f6c61726176656c2d696e766f696365732f6c6963656e7365)](https://packagist.org/packages/jhosagid/laravel-invoices)

[![version 2](https://camo.githubusercontent.com/e950a2892a5111839b798a60d05d3b45de8af79c01555fc1b0cc9535bcc56797/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76342532306d61696e74656e616e63652d7965732d677265656e3f7374796c653d666c6174)](https://packagist.org/packages/jhosagid/laravel-invoices)[![version 1](https://camo.githubusercontent.com/edf9f7cc576fb5375e6957662b82e78e791b42c7a2d0e04cfdeb55b396b0d95d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76332532306d61696e74656e616e63652d6e6f2d7265643f7374796c653d666c6174)](https://packagist.org/packages/jhosagid/laravel-invoices)

This Laravel package provides an easy to use interface to generate **Invoice PDF files** with your provided data.

Invoice file can be stored, downloaded, streamed on any of the filesystems you have configured. Supports different templates and locales.

Features
--------

[](#features)

- Taxes - fixed or rate - for item or for invoice
- Discounts - fixed or by percentage - for item or for invoice
- Shipping - add shipping price to your invoices
- Automatic calculation - provide minimal set of information, or calculate yourself and provide what to print
- Due date
- Easy to customize currency format
- Serial numbers as you like it
- Templates
- Translations
- Global settings and overrides on-the-fly

Installation
------------

[](#installation)

Via Composer

```
$ composer require jhosagid/laravel-invoices:^4.0
```

> [Older versions](PREVIOUS.md)

After installing Laravel Invoices, publish its assets, views, translations and config using the `invoices:install` Artisan command:

```
$ php artisan invoices:install
```

### Updates

[](#updates)

Since it is evolving fast you might want to have latest template after update using Artisan command:

```
$ php artisan invoices:update
```

> It will give a warning if you really want to override default resources

Or alternatively it can be done separately.

```
$ php artisan vendor:publish --tag=invoices.views --force
```

```
$ php artisan vendor:publish --tag=invoices.translations --force
```

Basic Usage
-----------

[](#basic-usage)

**RandomController.php**

```
use Jhosagid\Invoices\Invoice;
use Jhosagid\Invoices\Classes\Buyer;
use Jhosagid\Invoices\Classes\InvoiceItem;

// ...

$customer = new Buyer([
    'name'          => 'John Doe',
    'custom_fields' => [
        'email' => 'test@example.com',
    ],
]);

$item = InvoiceItem::make('Service 1')->pricePerUnit(2);

$invoice = Invoice::make()
    ->buyer($customer)
    ->discountByPercent(10)
    ->taxRate(15)
    ->shipping(1.99)
    ->addItem($item);

return $invoice->stream();
```

See result [Invoice\_AA\_00001.pdf](examples/invoice_AA_00001.pdf).

Advanced Usage
--------------

[](#advanced-usage)

```
use Jhosagid\Invoices\Invoice;
use Jhosagid\Invoices\Classes\Party;
use Jhosagid\Invoices\Classes\InvoiceItem;

// ...

$client = new Party([
    'name'          => 'Roosevelt Lloyd',
    'phone'         => '(520) 318-9486',
    'custom_fields' => [
        'note'        => 'IDDQD',
        'business id' => '365#GG',
    ],
]);

$customer = new Party([
    'name'          => 'Ashley Medina',
    'address'       => 'The Green Street 12',
    'code'          => '#22663214',
    'custom_fields' => [
        'order number' => '> 654321  7,
    ],

    'serial_number' => [
        'series'           => 'AA',
        'sequence'         => 1,
        /**
         * Sequence will be padded accordingly, for ex. 00001
         */
        'sequence_padding' => 5,
        'delimiter'        => '.',
        /**
         * Supported tags {SERIES}, {DELIMITER}, {SEQUENCE}
         * Example: AA.00001
         */
        'format'           => '{SERIES}{DELIMITER}{SEQUENCE}',
    ],

    'currency' => [
        'code'                => 'eur',
        /**
         * Usually cents
         * Used when spelling out the amount and if your currency has decimals.
         *
         * Example: Amount in words: Eight hundred fifty thousand sixty-eight EUR and fifteen ct.
         */
        'fraction'            => 'ct.',
        'symbol'              => '€',
        /**
         * Example: 19.00
         */
        'decimals'            => 2,
        /**
         * Example: 1.99
         */
        'decimal_point'       => '.',
        /**
         * By default empty.
         * Example: 1,999.00
         */
        'thousands_separator' => '',
        /**
         * Supported tags {VALUE}, {SYMBOL}, {CODE}
         * Example: 1.99 €
         */
        'format'              => '{VALUE} {SYMBOL}',
    ],

    'paper' => [
        // A4 = 210 mm x 297 mm = 595 pt x 842 pt
        'size'        => 'a4',
        'orientation' => 'portrait',
    ],

    'disk' => 'local',

    'seller' => [
        /**
         * Class used in templates via $invoice->seller
         *
         * Must implement Jhosagid\Invoices\Contracts\PartyContract
         *      or extend Jhosagid\Invoices\Classes\Party
         */
        'class' => \Jhosagid\Invoices\Classes\Seller::class,

        /**
         * Default attributes for Seller::class
         */
        'attributes' => [
            'name'          => 'Towne, Smith and Ebert',
            'address'       => '89982 Pfeffer Falls Damianstad, CO 66972-8160',
            'code'          => '41-1985581',
            'vat'           => '123456789',
            'phone'         => '760-355-3930',
            'custom_fields' => [
                /**
                 * Custom attributes for Seller::class
                 *
                 * Used to display additional info on Seller section in invoice
                 * attribute => value
                 */
                'SWIFT' => 'BANK101',
            ],
        ],
    ],
];
```

Available Methods
-----------------

[](#available-methods)

Almost every configuration value can be overrided dynamically by methods.

Invoice
-------

[](#invoice)

#### General

[](#general)

- addItem(InvoiceItem $item)
- addItems(Iterable)
- name(string)
- status(string) - invoice status \[paid/due\] if needed
- seller(PartyContract)
- buyer(PartyContract)
- setCustomData(mixed) - allows user to attach additional data to invoice
- getCustomData() - retrieves additional data to use in template
- template(string)
- logo(string) - path to logo
- getLogo() - returns base64 encoded image, used in template to avoid path issues
- filename(string) - overrides automatic filename
- taxRate(float)
- shipping(float) - shipping amount
- **totalDiscount(float) - If not provided calculates itself**
- **totalTaxes(float) - If not provided calculates itself**
- **totalAmount(float) - If not provided calculates itself**
- **taxableAmount(float) - If not provided calculates itself**

#### Serial number

[](#serial-number)

- series(string)
- sequence(int)
- delimiter(string)
- sequencePadding(int)
- serialNumberFormat(string)
- getSerialNumber() - returns formatted serial number

#### Date

[](#date)

- date(CarbonInterface)
- dateFormat(string) - Carbon format of date
- payUntilDays(int) - Days payment due since invoice issued
- getDate() - returns formatted date
- getPayUntilDate() - return formatted due date

#### Currency

[](#currency)

- currencyCode(string) - EUR, USD etc.
- currencyFraction(string) - Cents, Centimes, Pennies etc.
- currencySymbol(string)
- currencyDecimals(int)
- currencyDecimalPoint(string)
- currencyThousandsSeparator(string)
- currencyFormat(string)
- getAmountInWords(float, ?string $locale) - Spells out float to words, second parameter is locale
- getTotalAmountInWords() - spells out total\_amount
- formatCurrency(float) - returns formatted value with currency settings '$ 1,99'

#### File

[](#file)

- stream() - opens invoice in browser
- download() - offers to download invoice
- save($disk) - saves invoice to storage, use -&gt;filename() for filename
- url() - return url of saved invoice
- toHtml() - render html view instead of pdf

InvoiceItem
-----------

[](#invoiceitem)

- make(string) - \[static function\] same as `(new InvoiceItem())->title(string)`
- title(string) - product or service name
- description(string) - additional information for service entry
- units(string) - measurement units of item (adds units columns if set)
- quantity(float) - amount of units of item
- pricePerUnit(float)
- discount(float) - discount in currency
- discountByPercent(float) - discount by percents discountByPercent(15) means 15%
- tax(float)
- taxByPercent(float)
- **subTotalPrice(float) - If not provided calculates itself**

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

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

Author
------

[](#author)

- [David Lun](https://github.com/mc0de)

License
-------

[](#license)

GPL-3.0-only. Please see the [license file](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.6% 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 ~2 days

Total

5

Last Release

547d ago

### Community

Maintainers

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

---

Top Contributors

[![mc0de](https://avatars.githubusercontent.com/u/8727992?v=4)](https://github.com/mc0de "mc0de (105 commits)")[![itskawsar](https://avatars.githubusercontent.com/u/1224493?v=4)](https://github.com/itskawsar "itskawsar (9 commits)")[![PovilasKorop](https://avatars.githubusercontent.com/u/1510147?v=4)](https://github.com/PovilasKorop "PovilasKorop (8 commits)")[![jhosagid7](https://avatars.githubusercontent.com/u/13604839?v=4)](https://github.com/jhosagid7 "jhosagid7 (8 commits)")[![ryancco](https://avatars.githubusercontent.com/u/20148569?v=4)](https://github.com/ryancco "ryancco (6 commits)")[![Marius-K](https://avatars.githubusercontent.com/u/35399830?v=4)](https://github.com/Marius-K "Marius-K (4 commits)")[![s-damian](https://avatars.githubusercontent.com/u/10757326?v=4)](https://github.com/s-damian "s-damian (3 commits)")[![xnekv03](https://avatars.githubusercontent.com/u/17554971?v=4)](https://github.com/xnekv03 "xnekv03 (2 commits)")[![dnwjn](https://avatars.githubusercontent.com/u/57711725?v=4)](https://github.com/dnwjn "dnwjn (2 commits)")[![LaravelDaily](https://avatars.githubusercontent.com/u/15341846?v=4)](https://github.com/LaravelDaily "LaravelDaily (2 commits)")[![luca-alsina](https://avatars.githubusercontent.com/u/61733648?v=4)](https://github.com/luca-alsina "luca-alsina (2 commits)")[![Scarbous](https://avatars.githubusercontent.com/u/1202318?v=4)](https://github.com/Scarbous "Scarbous (2 commits)")[![Treggats](https://avatars.githubusercontent.com/u/27585?v=4)](https://github.com/Treggats "Treggats (2 commits)")[![krls2020](https://avatars.githubusercontent.com/u/73657806?v=4)](https://github.com/krls2020 "krls2020 (1 commits)")[![flavius-constantin](https://avatars.githubusercontent.com/u/23703860?v=4)](https://github.com/flavius-constantin "flavius-constantin (1 commits)")[![noud](https://avatars.githubusercontent.com/u/1333629?v=4)](https://github.com/noud "noud (1 commits)")[![EraTorr](https://avatars.githubusercontent.com/u/10467084?v=4)](https://github.com/EraTorr "EraTorr (1 commits)")[![dodaydream](https://avatars.githubusercontent.com/u/20422615?v=4)](https://github.com/dodaydream "dodaydream (1 commits)")[![vildanbina](https://avatars.githubusercontent.com/u/51203303?v=4)](https://github.com/vildanbina "vildanbina (1 commits)")[![Dartui](https://avatars.githubusercontent.com/u/2657856?v=4)](https://github.com/Dartui "Dartui (1 commits)")

---

Tags

laravelpdfinvoiceinvoices

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[laraveldaily/laravel-invoices

Missing invoices for Laravel

1.5k1.3M4](/packages/laraveldaily-laravel-invoices)[anam/phantommagick

PhantomMagick provides a simple API to ease the process of converting HTML to PDF or images

161456.4k2](/packages/anam-phantommagick)

PHPackages © 2026

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