PHPackages                             twm/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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. twm/laravel-invoice

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

twm/laravel-invoice
===================

This is my package laravel-invoice

1.0(2y ago)0154[3 PRs](https://github.com/alextwm/laravel-invoice/pulls)MITPHPPHP ^8.1|^8.2

Since May 29Pushed 2y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (11)Versions (5)Used By (0)

This is my package laravel-invoice
==================================

[](#this-is-my-package-laravel-invoice)

[![Latest Version on Packagist](https://camo.githubusercontent.com/46e385a1d036f24a92dd9f1be854df2654b5c60e654939df5ba5a9e23e3d3ab1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74776d2f6c61726176656c2d696e766f6963652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/twm/laravel-invoice)[![GitHub Tests Action Status](https://camo.githubusercontent.com/eb72bc54e63e1dbde6818f982465e5b801c14bc1a4038b84342300e0d02839c9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f74776d2f6c61726176656c2d696e766f6963652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/twm/laravel-invoice/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/f1888cad189d262facb058dfa4a9617745b4c0e4d2b4efdd670e0c21469654b0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f74776d2f6c61726176656c2d696e766f6963652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/twm/laravel-invoice/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/6b7d1d62bf8d8e96ae38b902fcad28e3cf15f94d42d78b8c4af99bcd2ca8d23b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74776d2f6c61726176656c2d696e766f6963652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/twm/laravel-invoice)

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/1f73646e1b7c4830e602389752152a444fcea6ef4acb228838a20b3d41fe117d/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d696e766f6963652e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-invoice)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

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

[](#installation)

You can install the package via composer:

```
composer require twm/laravel-invoice
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="laravel-invoice-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-invoice-config"
```

This is the contents of the published config file:

```
return [
];
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="laravel-invoice-views"
```

Usage
-----

[](#usage)

```
// You have to create an array with pairs key-value with invoice table columns

$example = [
   'client_id' => null,
        'customer_name' => $faker->company(),
        'customer_reg_com_nr' => $faker->word(),
        'customer_cui' => $faker->word(),
        'customer_address' => $faker->address(),
        'customer_iban' => Str::random(10),
        'customer_bank' => $faker->word(),
        'customer_county' => 'Bucuresti',
        'provider_name' => $faker->company(),
        'provider_reg_com_nr' => $faker->word(),
        'provider_cui' => $faker->word(),
        'provider_address' => $faker->address(),
        'provider_iban' => Str::random(10),
        'provider_bank' => $faker->word(),
        'provider_capital' => '200 RON',
        'cota' => 19,
        'termen_de_plata' => '2023-05-31',
        'payment_url' => 'www.example.com' //optional
];

/** For each line of invoice lines you have to create a collection with lines like this */

// Initialize an empty collection

$linesCollection = collect([]);

foreach($lines as $line) {
   $line = (new Line())->name('Product name')
                        ->unit('buc')
                        ->quantity(4)
                        ->price(100)
                        ->pret_fara_tva(19)
                        ->valoare_fara_tva(19)
                        ->valoare_tva(19);
   // If you want to create a line with discount you have to use the discount method after price method
                        '.....'
                        ->price(100)
                        ->discount(100)
                        '.....'

   $linesCollection->push($line);
}

/** To generate invoice you have to use this line */

$invoice = InvoiceGenerator::init()->make($example)->lines($linesCollection);

/** first argument is the name of invoice and the second is the disk you want to save the invoice */
$invoice->generate('Invoice_name.pdf','local');

/** If you want to generate an existing invoice use this */

$inv = Invoice::first();

GenerateExisting::generate($inv,'Invoice_name.pdf');
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Popa Alexandru](https://github.com/twm)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 95.8% 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

Unknown

Total

1

Last Release

1067d ago

### Community

Maintainers

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

---

Top Contributors

[![alextwm](https://avatars.githubusercontent.com/u/114927366?v=4)](https://github.com/alextwm "alextwm (138 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

laravelLaravel InvoiceTwm

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

9963.4M11](/packages/spatie-laravel-pdf)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)

PHPackages © 2026

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