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

ActiveLibrary[Payment Processing](/categories/payments)

akira/laravel-pdf-invoices
==========================

A modern, strictly typed, and extensible invoice generator for Laravel 12+ built with PHP 8.4 syntax. This package provides a clean builder pattern API, immutable data objects, and modular design inspired by LaravelDaily/laravel-invoices but rewritten from scratch with SOLID principles and Laravel best practices.

v1.7.0(3mo ago)37912↓35.7%5[2 PRs](https://github.com/akira-io/laravel-pdf-invoices/pulls)2MITPHPPHP ^8.4CI passing

Since Oct 27Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/akira-io/laravel-pdf-invoices)[ Packagist](https://packagist.org/packages/akira/laravel-pdf-invoices)[ Docs](https://github.com/akira-io/laravel-pdf-invoices)[ GitHub Sponsors](https://github.com/kidiatoliny)[ RSS](/packages/akira-laravel-pdf-invoices/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (10)Dependencies (20)Versions (15)Used By (2)

[![img.png](docs/assets/banner.png)](docs/assets/banner.png)

 [![Latest Version on Packagist](https://camo.githubusercontent.com/2b215fd8d02bac766e13c854ccf91f0fd3e4e747c85d55c0f8c32dc764307fcf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616b6972612f6c61726176656c2d7064662d696e766f696365732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/akira/laravel-pdf-invoices) [![GitHub Tests](https://camo.githubusercontent.com/9e54c62ad2c99f868b0777c86c12a730f3da01b971ff84e12887e6930da63c5c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616b6972612d696f2f6c61726176656c2d7064662d696e766f696365732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/akira-io/laravel-pdf-invoices/actions?query=workflow%3Arun-tests+branch%3Amain) [![Code Style](https://camo.githubusercontent.com/e72ad9ff682e7a1491eba439aeb0a32c8547b22ed001c22ac362981e7da20fbe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616b6972612d696f2f6c61726176656c2d7064662d696e766f696365732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/akira-io/laravel-pdf-invoices/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain) [![Total Downloads](https://camo.githubusercontent.com/c20d4599660edf20e36be936d835823d1b8aa6e5966b779e053f5e59fc74d5e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616b6972612f6c61726176656c2d7064662d696e766f696365732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/akira/laravel-pdf-invoices)

Beautiful, type-safe PDF invoice generator for Laravel 12+ with a fluent builder API, multiple professional templates, and multi-language support.

Features
--------

[](#features)

- **Builder Pattern** - Chainable, fluent API for creating invoices
- **Type-Safe** - Strict types, readonly DTOs, zero magic
- **Carbon Support** - Seamless `Carbon` and `CarbonImmutable` integration for Laravel 11+
- **3 Templates** - Minimal, modern, and branded designs (Tailwind CSS)
- **Multi-Language** - English, Portuguese, French (easily extensible)
- **Custom Fields** - Add any custom attributes to entities
- **Currency Support** - Flexible formatting with Laravel integration
- **Multiple PDF Engines** - Choose between Spatie (Browsershot/Chromium) or DomPDF
- **Fully Tested** - Comprehensive PestPHP test suite
- **Quality Tools** - PHPStan level max, Laravel Pint, Rector

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

[](#installation)

Install via Composer:

```
composer require akira/laravel-pdf-invoices
```

Choose your PDF generation engine:

### Option 1: Spatie (Browsershot/Chromium) - Default

[](#option-1-spatie-browsershotchromium---default)

Best for complex layouts and JavaScript rendering.

#### Runtime dependencies

[](#runtime-dependencies)

- **Node.js**: Required to run Browsershot/Puppeteer.
- **Chromium or Google Chrome**: A headless browser instance.
- **Puppeteer**: Must be installed manually as a Node dependency.

```
npm install puppeteer
```

`spatie/browsershot` is installed automatically as a package dependency.

### Option 2: DomPDF

[](#option-2-dompdf)

Pure PHP solution, no Node.js required:

```
# DomPDF is included as a dependency, no additional steps needed
```

Then publish assets:

```
php artisan vendor:publish --provider="Akira\PdfInvoices\PdfInvoicesServiceProvider"
```

Configure your PDF engine in `.env`:

```
# Use 'spatie' (default) or 'dompdf'
INVOICES_PDF_DRIVER=spatie
```

[Learn more about PDF generators →](docs/02-pdf-generators.md)

Quick Start
-----------

[](#quick-start)

```
use Akira\PdfInvoices\Builders\InvoiceBuilder;
use Akira\PdfInvoices\Builders\EntityBuilder;
use Akira\PdfInvoices\Builders\ItemBuilder;

$invoice = InvoiceBuilder::make()
    ->seller(
        EntityBuilder::make()
            ->name('Your Company')
            ->address('123 Main St, City')
            ->email('hello@company.com')
            ->vat('123456789')
            ->build()
    )
    ->buyer(
        EntityBuilder::make()
            ->name('Client Name')
            ->email('client@example.com')
            ->address('456 Oak Ave, Town')
            ->vat('987654321')
            ->build()
    )
    ->addItem(
        ItemBuilder::make()
            ->description('Professional Services')
            ->unitPrice(150)
            ->quantity(10)
            ->tax(0.19)
            ->build()
    )
    ->addItem(
        ItemBuilder::make()
            ->description('Support & Maintenance')
            ->unitPrice(100)
            ->quantity(5)
            ->tax(0.19)
            ->discount(0.10)
            ->build()
    )
    ->locale('en')
    ->notes('Payment due within 30 days.')
    ->build();

// Generate and save PDF
$pdf = $invoice->generatePdf();
$pdf->save('invoices/invoice-001.pdf');

// Or get as stream (for downloads/email)
return response()->streamDownload(
    fn() => echo $pdf,
    'invoice-001.pdf'
);
```

Templates
---------

[](#templates)

Choose your preferred invoice style:

### Minimal

[](#minimal)

Clean and simple, perfect for service invoices.

### Modern

[](#modern)

Contemporary design with gradient header and professional layout.

### Branded

[](#branded)

Business-focused with color accents for custom branding.

```
// Use a specific template
$pdf = $invoice->generatePdf(template: 'branded');
```

Localization
------------

[](#localization)

Generate invoices in different languages by setting the locale in the builder:

```
// Portuguese invoice
$invoice = InvoiceBuilder::make()
    ->locale('pt')
    // ... other methods
    ->build();

// French invoice
$invoice = InvoiceBuilder::make()
    ->locale('fr')
    // ... other methods
    ->build();

// English invoice (default)
$invoice = InvoiceBuilder::make()
    ->locale('en')
    // ... other methods
    ->build();
```

Supported: English (`en`), Portuguese (`pt`), French (`fr`)

[View all translation keys →](docs/08-localization.md)

Custom Attributes
-----------------

[](#custom-attributes)

Add custom fields to any entity:

```
$seller = EntityBuilder::make()
    ->name('Company')
    ->withAttributes([
        'bank_account' => 'IBAN123456',
        'registration' => 'REG-123',
    ])
    ->build();

// Access them
$seller->attributes('bank_account'); // IBAN123456
```

Currency Formatting
-------------------

[](#currency-formatting)

Use Laravel's currency or custom formatters:

```
// Laravel currency (respects app.php locale)
$invoice->currency = 'EUR';

// Custom currency symbol
$invoice->currency = '$';
```

Storage
-------

[](#storage)

Save invoices to disk or custom storage:

```
// Save to storage/app/invoices
$storage = app(\Akira\PdfInvoices\Contracts\StorageDriverContract::class);
$storage->save('invoice-001.pdf', $pdf);

// Or use Laravel Storage facade directly
\Illuminate\Support\Facades\Storage::put('invoices/invoice-001.pdf', $pdf);
```

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

[](#advanced-usage)

### Discounts &amp; Taxes

[](#discounts--taxes)

```
ItemBuilder::make()
    ->description('Service')
    ->unitPrice(1000)
    ->quantity(2)
    ->tax(0.19)           // 19% tax
    ->discount(0.10)      // 10% discount on subtotal
    ->build()
```

### Custom Invoice Numbers &amp; Dates

[](#custom-invoice-numbers--dates)

```
$invoice = InvoiceBuilder::make()
    ->invoiceNumber('INV-2024-001')
    ->issuedAt(now())
    ->dueAt(now()->addDays(30))
    // ...
    ->build();
```

### Carbon &amp; CarbonImmutable Support

[](#carbon--carbonimmutable-support)

The date methods accept both `Carbon` (mutable) and `CarbonImmutable` (immutable) instances, as well as any `DateTimeInterface` implementation. This makes it seamless to work with Laravel 11+ which uses `CarbonImmutable` by default:

```
// All of these work seamlessly:
$invoice->issuedAt(Carbon::now());              // Mutable Carbon
$invoice->issuedAt(now());                      // CarbonImmutable (Laravel default)
$invoice->issuedAt(new DateTime('2024-01-01')); // DateTime
$invoice->issuedAt($model->created_at);         // Eloquent model attribute (CarbonImmutable)
```

### Accessing Calculations

[](#accessing-calculations)

```
$invoice->getSubtotal();      // Sum of all items
$invoice->getTotalTax();      // Total tax amount
$invoice->getTotalDiscount(); // Total discount amount
$invoice->getTotal();         // Final amount due
```

Testing
-------

[](#testing)

Run the test suite:

```
composer test
```

With coverage:

```
composer test -- --coverage
```

Documentation
-------------

[](#documentation)

- [Full Documentation](docs/00-index.md)
- [Usage Guide](docs/01-usage.md)
- [PDF Generators](docs/02-pdf-generators.md)
- [Builder Pattern](docs/03-builders.md)
- [Custom Attributes](docs/04-attributes.md)
- [Templates Guide](docs/05-templates.md)
- [Custom Templates](docs/06-creating-custom-templates.md)
- [Customization](docs/07-customization.md)
- [Localization](docs/08-localization.md)
- [CSS Compilation](docs/09-css-compilation.md)
- [Contributing](docs/10-contributing.md)

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for recent changes and updates.

License
-------

[](#license)

The MIT License (MIT). See [LICENSE.md](LICENSE.md) for details.

Credits
-------

[](#credits)

Built with Laravel best practices and inspired by the Laravel community.

- [Kidiatoliny](https://github.com/kidiatoliny) - Creator
- [All Contributors](https://github.com/akira-io/laravel-pdf-invoices/graphs/contributors)

Support
-------

[](#support)

Having issues? Check out the [documentation](docs/) or open an [issue on GitHub](https://github.com/akira-io/laravel-pdf-invoices/issues).

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance86

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 93.3% 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 ~12 days

Recently: every ~27 days

Total

13

Last Release

56d ago

### Community

Maintainers

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

---

Top Contributors

[![kidiatoliny](https://avatars.githubusercontent.com/u/48266788?v=4)](https://github.com/kidiatoliny "kidiatoliny (84 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelpdfbillinginvoicesakirainvoice-generatorlaravel-pdf-invoicesbilling-systembilling-invoicespdf-invoicespdf-invoice-generatorlaravel-invoice-generator

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[laraveldaily/laravel-invoices

Missing invoices for Laravel

1.5k1.3M4](/packages/laraveldaily-laravel-invoices)[danestves/laravel-polar

A package to easily integrate your Laravel application with Polar.sh

7812.3k](/packages/danestves-laravel-polar)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[asciisd/knet

Knet package is provides an expressive, fluent interface to KNet's payment services.

141.1k](/packages/asciisd-knet)

PHPackages © 2026

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