PHPackages                             pat-o-dev/factur-x-laravel - 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. pat-o-dev/factur-x-laravel

ActiveLibrary

pat-o-dev/factur-x-laravel
==========================

Laravel bridge for pat-o-dev/factur-x: ServiceProvider, Facade and Artisan command to generate Factur-X invoices.

v0.4.0(today)119↑2900%MITPHPPHP ^8.2

Since Jul 30Pushed todayCompare

[ Source](https://github.com/pat-o-dev/factur-x-laravel)[ Packagist](https://packagist.org/packages/pat-o-dev/factur-x-laravel)[ RSS](/packages/pat-o-dev-factur-x-laravel/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (6)Versions (6)Used By (0)

pat-o-dev/factur-x-laravel
==========================

[](#pat-o-devfactur-x-laravel)

Laravel bridge for [`pat-o-dev/factur-x`](https://github.com/pat-o-dev/factur-x): a `ServiceProvider`, a `FacturX` facade, a default invoice template, and a full `Invoice` → rendered PDF → Factur-X hybrid PDF pipeline.

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

[](#installation)

```
composer require pat-o-dev/factur-x-laravel
```

Usage
-----

[](#usage)

### Low-level: XML / hybridizing your own PDF

[](#low-level-xml--hybridizing-your-own-pdf)

```
use PatODev\FacturX\Laravel\Facades\FacturX;

// $invoice is a PatODev\FacturX\Model\Invoice (see pat-o-dev/factur-x README)
$xml = FacturX::generateXml($invoice);

$basePdf = /* bytes of a PDF/A invoice you already render, e.g. via mPDF */;
$hybridPdf = FacturX::generateHybridPdf($invoice, $basePdf);
```

### Full pipeline: render the invoice template and hybridize in one call

[](#full-pipeline-render-the-invoice-template-and-hybridize-in-one-call)

`FacturXInvoiceGenerator` renders a Blade view to HTML, converts it to PDF/A via mPDF, then hybridizes it — no need to bring your own PDF renderer:

```
use PatODev\FacturX\Laravel\FacturXInvoiceGenerator;

$hybridPdf = app(FacturXInvoiceGenerator::class)->generate($invoice);

return response($hybridPdf, 200, [
    'Content-Type' => 'application/pdf',
    'Content-Disposition' => 'attachment; filename="'.$invoice->number.'.pdf"',
]);
```

### Customizing the invoice template

[](#customizing-the-invoice-template)

Publish the default Blade view and edit it directly:

```
php artisan vendor:publish --tag=factur-x-views
# -> resources/views/vendor/factur-x/invoice.blade.php
```

Or point `config('factur-x.view')` at your own view name entirely.

### Using a different rendering engine (Twig, pre-rendered React/Vue, ...)

[](#using-a-different-rendering-engine-twig-pre-rendered-reactvue-)

`FacturXInvoiceGenerator` depends on the `PatODev\FacturX\Laravel\Rendering\InvoiceHtmlRenderer` interface (`render(Invoice $invoice): string`, returning HTML), bound by default to `BladeInvoiceRenderer`. Rebind it in a service provider to swap engines:

```
$this->app->bind(InvoiceHtmlRenderer::class, MyCustomRenderer::class);
```

Note: the HTML is converted to PDF/A by mPDF, which renders static HTML/CSS only — it does not execute JavaScript. A React/Vue-based renderer must server-side render to a plain HTML string before returning it (client-side hydration won't run inside the PDF converter).

### mPDF / PDF/A options

[](#mpdf--pdfa-options)

`config('factur-x.pdfa_version')` (default `3-B`) and `config('factur-x.mpdf_config')` (merged into the `Mpdf` constructor config, e.g. `format`, `tempDir`) control the base PDF produced by the default `InvoicePdfARenderer` (`MpdfInvoicePdfRenderer`). Swap that binding the same way as `InvoiceHtmlRenderer` to use a different PDF/A engine (e.g. TCPDF).

Publishing
----------

[](#publishing)

```
php artisan vendor:publish --tag=factur-x-config  # config/factur-x.php
php artisan vendor:publish --tag=factur-x-views   # resources/views/vendor/factur-x/
```

Testing
-------

[](#testing)

```
composer install
vendor/bin/phpunit
```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

5

Last Release

0d ago

### Community

Maintainers

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

---

Top Contributors

[![pat-o-dev](https://avatars.githubusercontent.com/u/28396761?v=4)](https://github.com/pat-o-dev "pat-o-dev (8 commits)")

---

Tags

laravelfactur-xe-invoicingEN16931facture-electronique

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pat-o-dev-factur-x-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/pat-o-dev-factur-x-laravel/health.svg)](https://phpackages.com/packages/pat-o-dev-factur-x-laravel)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M348](/packages/psalm-plugin-laravel)[moonshine/moonshine

Laravel administration panel

1.3k253.1k86](/packages/moonshine-moonshine)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

728176.2k14](/packages/tallstackui-tallstackui)[hasinhayder/tyro-dashboard

Tyro Dashboard - Beautiful admin dashboard for managing Tyro roles, privileges, users, and settings

5443.8k](/packages/hasinhayder-tyro-dashboard)[webwizo/laravel-shortcodes

Wordpress like shortcodes for Laravel 11, 12 and 13

217700.9k8](/packages/webwizo-laravel-shortcodes)[hasinhayder/tyro-login

Tyro Login - Beautiful, customizable authentication views for Laravel 12 &amp; 13

2484.9k6](/packages/hasinhayder-tyro-login)

PHPackages © 2026

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