PHPackages                             ardhikaxx/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. ardhikaxx/laravel-invoice

ActiveLibrary

ardhikaxx/laravel-invoice
=========================

A complete, professional, and production-ready invoice engine for Laravel.

v1.1.2(2d ago)012↓50%MITPHPPHP ^8.2CI passing

Since Aug 16Pushed 2d agoCompare

[ Source](https://github.com/ardhikaxx/laravel-invoice)[ Packagist](https://packagist.org/packages/ardhikaxx/laravel-invoice)[ RSS](/packages/ardhikaxx-laravel-invoice/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (7)Versions (5)Used By (0)

Laravel Invoice
===============

[](#laravel-invoice)

[![Tests](https://github.com/ardhikaxx/laravel-invoice/actions/workflows/tests.yml/badge.svg)](https://github.com/ardhikaxx/laravel-invoice/actions)[![Latest Version on Packagist](https://camo.githubusercontent.com/f540a0c3f65159f4e97490ac083e4b01240048f28092733d4fb32fc967a37e1e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61726468696b6178782f6c61726176656c2d696e766f6963652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ardhikaxx/laravel-invoice)[![PHP Version Require](https://camo.githubusercontent.com/405c505dc744674051f17c751aedbf4ab77e6bf74393ab779828d87a85228208/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f61726468696b6178782f6c61726176656c2d696e766f6963653f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ardhikaxx/laravel-invoice)[![License](https://camo.githubusercontent.com/9e0a56b9549886e7a92db623cce51a3b622177d9e8ffbdfb3eebebb299691940/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f61726468696b6178782f6c61726176656c2d696e766f6963653f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ardhikaxx/laravel-invoice)

A complete, professional, and production-ready invoice engine for Laravel.

This package is designed for building robust invoice systems in e-commerce, POS, SaaS, or any other enterprise applications. It provides the full business logic out-of-the-box: invoice generation, precise tax/discount calculation, partial payments, state management, PDF generation, and public verification.

Features
--------

[](#features)

- **Fluent API**: Create invoices easily using the `InvoiceBuilder`.
- **Decimal-Safe Engine**: Financial amounts are stored and calculated using precise decimal operations to prevent floating-point errors.
- **Concurrent-Safe Numbering**: Auto-generates invoice sequences (e.g., `INV-2026-08-000001`) safely using DB transactions and locking.
- **Payment Tracking**: Track partial payments. Automatically transitions invoice statuses from `Pending` -&gt; `Partially Paid` -&gt; `Paid`.
- **Extensible Architecture**: Swap out the PDF Generator or Payment Gateway via Service Container bindings and Contracts.
- **REST API included**: Built-in API endpoints for fetching, paginating, downloading PDFs, and verifying QR Code tokens.
- **Fully Customizable**: Extend the underlying `Customer` model or override the provided Blade templates.

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

[](#installation)

You can install the package via composer:

```
composer require ardhikaxx/laravel-invoice
```

Publish the configuration file, migrations, and views:

```
php artisan vendor:publish --provider="Ardhikaxx\LaravelInvoice\InvoiceServiceProvider"
```

Run the migrations:

```
php artisan migrate
```

Configuration
-------------

[](#configuration)

You can customize the package via `config/invoice.php`.

- **`prefix`** &amp; **`number_format`**: Adjust how the invoice number is generated.
- **`currency`** &amp; **`decimal_precision`**: Setup localization and rounding.
- **`company`**: Define the company details displayed on the PDF.
- **`models.customer`**: Bind your application's existing User/Customer model to the invoice system.

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

[](#basic-usage)

### Creating an Invoice

[](#creating-an-invoice)

Use the `InvoiceBuilder` to quickly create an invoice with items.

```
use Ardhikaxx\LaravelInvoice\Services\InvoiceBuilder;
use Ardhikaxx\LaravelInvoice\Models\Customer;

$customer = Customer::find(1);

$invoice = InvoiceBuilder::make()
    ->customer($customer)
    ->date(now())
    ->dueDate(now()->addDays(14))
    ->addItem('Web Development Services', 1, 5000000, ['tax' => 550000])
    ->addItem('Server Maintenance', 12, 150000)
    ->notes('Thank you for your business!')
    ->save();

echo $invoice->invoice_number; // e.g., INV-2026-08-000001
echo $invoice->grand_total; // 7,350,000.00
```

### Adding a Payment

[](#adding-a-payment)

The `PaymentService` automatically updates the invoice status when the balance is fulfilled.

```
use Ardhikaxx\LaravelInvoice\Services\PaymentService;

$service = new PaymentService();

// Add a partial payment
$service->addPayment($invoice, 3000000, [
    'payment_method' => 'Bank Transfer',
    'notes' => 'First installment'
]);

// Invoice status is now `partially_paid`

// Pay the remainder
$service->addPayment($invoice, $invoice->due_amount);

// Invoice status is automatically transitioned to `paid`
// Event `InvoicePaid` is dispatched!
```

### Generating PDF

[](#generating-pdf)

```
use Ardhikaxx\LaravelInvoice\Contracts\PdfGeneratorInterface;

$pdfGenerator = app(PdfGeneratorInterface::class);

// Download directly (e.g., in a controller return)
return $pdfGenerator->download($invoice);

// Save to disk
$url = $pdfGenerator->save($invoice, 'public/invoices/inv-123.pdf');
```

### Emailing the Invoice

[](#emailing-the-invoice)

Send the invoice directly to the customer's email (with the PDF automatically attached):

```
// Will send to $invoice->customer->email
$invoice->sendToCustomer();

// Or specify an email directly
$invoice->sendToCustomer('finance@company.com');
```

Console Commands
----------------

[](#console-commands)

You can quickly generate a mock invoice via terminal for testing or debugging:

```
php artisan invoice:create --customer_id=1 --amount=500000
```

REST API Endpoints
------------------

[](#rest-api-endpoints)

Once installed, the following endpoints are available under the `api` middleware:

- `GET /api/invoices` - List invoices
- `GET /api/invoices/{uuid}` - Get specific invoice details
- `GET /api/invoices/{uuid}/pdf` - Download invoice PDF
- `GET /invoice/verify/{token}` - Public verification URL (ideal for QR Codes)

Testing
-------

[](#testing)

```
composer test
```

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

[](#security-vulnerabilities)

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

---

💖 Dukungan &amp; Donasi
-----------------------

[](#-dukungan--donasi)

Jika *library* ini bermanfaat bagi Anda dan telah menghemat banyak jam kerja Anda, Anda dapat menunjukkan apresiasi dengan memberikan traktiran kopi (donasi) melalui pemindaian kode QRIS di bawah ini:

[![QRIS Donasi](./qris.png)](./qris.png)

---

📝 Lisensi
---------

[](#-lisensi)

Proyek ini bersifat *open-source* dan didistribusikan di bawah [Lisensi MIT](LICENSE).

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance99

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

4

Last Release

2d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f57dff3149ed99d2e38e7807e7593f3c5974cd040cb512621ba81fd1cdbbef0?d=identicon)[ardhikaxx](/maintainers/ardhikaxx)

---

Top Contributors

[![ardhikaxx](https://avatars.githubusercontent.com/u/124660694?v=4)](https://github.com/ardhikaxx "ardhikaxx (12 commits)")

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M319](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

20433.0M1.8k](/packages/illuminate-queue)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45844.8k1](/packages/pressbooks-pressbooks)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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