PHPackages                             ismailua/ubltr-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. ismailua/ubltr-invoice

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

ismailua/ubltr-invoice
======================

A Laravel package for generating UBL-TR compliant XML invoices

v1.0.0(1y ago)021[1 PRs](https://github.com/ismailua/ubltr-invoice/pulls)MITPHPPHP ^8.0CI failing

Since Apr 29Pushed 1y ago1 watchersCompare

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

READMEChangelogDependencies (4)Versions (2)Used By (0)

UBL-TR Invoice Generator for Laravel
====================================

[](#ubl-tr-invoice-generator-for-laravel)

A Laravel package for generating UBL-TR compliant XML invoices

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

[](#installation)

1. Install the package via Composer:

```
composer require ismailua/ubltr-invoice
```

2. Publish the configuration file:

```
php artisan vendor:publish --tag=config
```

Usage
-----

[](#usage)

```
use Ismailua\UblTrInvoice\Facades\UBLInvoice;
use Ismailua\UblTrInvoice\Models\UblInvoice\Invoice;
use Ismailua\UblTrInvoice\Models\UblInvoice\Party;
use Ismailua\UblTrInvoice\Models\UblInvoice\Address;
use Ismailua\UblTrInvoice\Models\UblInvoice\PartyIdentification;
use Ismailua\UblTrInvoice\Models\UblInvoice\PartyTaxScheme;
use Ismailua\UblTrInvoice\Models\UblInvoice\Contact;
use Ismailua\UblTrInvoice\Models\UblInvoice\Tax;
use Ismailua\UblTrInvoice\Models\UblInvoice\TaxSubtotal;
use Ismailua\UblTrInvoice\Models\UblInvoice\TaxScheme;
use Ismailua\UblTrInvoice\Models\UblInvoice\LegalMonetaryTotal;
use Ismailua\UblTrInvoice\Models\UblInvoice\InvoiceLine;
use Ismailua\UblTrInvoice\Models\UblInvoice\Item;
use Ismailua\UblTrInvoice\Models\UblInvoice\Price;

$invoice = new Invoice();
$invoice->id = 'TST2021000000002';
$invoice->issueDate = '2021-02-10';
$invoice->issueTime = '11:11:24';
$invoice->note = 'Yalnız Bir TL OnSekiz kuruş';
$invoice->lineCountNumeric = 1;

// Supplier Party
$supplier = new Party();
$supplier->addPartyIdentification((new PartyIdentification())->setId('1923001923')->setSchemeID('VKN'));
$supplier->addPartyIdentification((new PartyIdentification())->setId('1111111111111111')->setSchemeID('MERSISNO'));
$supplier->setPartyName('İsmail ÇAKIR');
$supplier->setPostalAddress((new Address())
    ->setRoom('19')
    ->setBuildingName('Test Binası')
    ->setBuildingNumber('23')
    ->setCitySubdivisionName('Kartal')
    ->setCityName('İstanbul')
    ->setCountryCode('TR')
    ->setCountryName('Türkiye'));
$supplier->setPartyTaxScheme((new PartyTaxScheme())->setName('Kartal Vergi Dairesi'));
$invoice->accountingSupplierParty = $supplier;

// Customer Party
$customer = new Party();
$customer->addPartyIdentification((new PartyIdentification())->setId('6090408038')->setSchemeID('VKN'));
$customer->setPartyName('FIRMA ELEKTRONİK TİCARET HİZMETLERİ ANONİM ŞİRKETİ');
$customer->setPostalAddress((new Address())
    ->setStreetName('Test')
    ->setCitySubdivisionName('Test')
    ->setCityName('Test')
    ->setCountryCode('TR')
    ->setCountryName('Türkiye'));
$customer->setPartyTaxScheme((new PartyTaxScheme())->setName('test vergi dairesi'));
$customer->setContact((new Contact())->setElectronicMail('test@test.com'));
$invoice->accountingCustomerParty = $customer;

// Tax Total
$tax = new Tax();
$tax->setTaxAmount(0.18);
$tax->addTaxSubtotal((new TaxSubtotal())
    ->setTaxableAmount(1)
    ->setTaxAmount(0.18)
    ->setPercent(18)
    ->setTaxScheme((new TaxScheme())->setName('KDV GERCEK')->setTaxTypeCode('0015')));
$invoice->taxTotal = $tax;

// Legal Monetary Total
$legalMonetaryTotal = new LegalMonetaryTotal();
$legalMonetaryTotal->setLineExtensionAmount(1);
$legalMonetaryTotal->setTaxExclusiveAmount(1);
$legalMonetaryTotal->setTaxInclusiveAmount(1.18);
$legalMonetaryTotal->setPayableAmount(1.18);
$invoice->legalMonetaryTotal = $legalMonetaryTotal;

// Invoice Line
$invoiceLine = new InvoiceLine();
$invoiceLine->setId('1');
$invoiceLine->setInvoicedQuantity(1);
$invoiceLine->setLineExtensionAmount(1);
$invoiceLine->setTaxTotal((new Tax())
    ->setTaxAmount(0.18)
    ->addTaxSubtotal((new TaxSubtotal())
        ->setTaxableAmount(1)
        ->setTaxAmount(0.18)
        ->setPercent(18)
        ->setTaxScheme((new TaxScheme())->setName('KDV GERCEK')->setTaxTypeCode('0015'))));
$invoiceLine->setItem((new Item())
    ->setDescription('test')
    ->setName('test')
    ->setSellersItemIdentification('test'));
$invoiceLine->setPrice((new Price())->setPriceAmount(1));
$invoice->invoiceLines = [$invoiceLine];

$xml = UBLInvoice::generate($invoice);
file_put_contents('invoice.xml', $xml);
```

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

[](#configuration)

The configuration file is located at `config/ubl-invoice.php`. You can modify default values such as currency and invoice type.

Testing
-------

[](#testing)

Run the tests using:

```
vendor/bin/phpunit
```

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

[](#contributing)

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

Support
-------

[](#support)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance49

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

377d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3558eaf7c2548cc4a01f3129bde0335ea529e6079e3f1bdef6dcc1ef8c8dc906?d=identicon)[ismailua](/maintainers/ismailua)

---

Top Contributors

[![ismailua](https://avatars.githubusercontent.com/u/24249330?v=4)](https://github.com/ismailua "ismailua (13 commits)")

---

Tags

ublUbl-TRUbl-TR InvoiceUbl-TR Invoice GeneratorUbl-TR Invoice Generator LaravelUbl-TR Invoice Generator Laravel PackageUbl-TR Invoice Generator For Laravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ismailua-ubltr-invoice/health.svg)

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

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M711](/packages/maatwebsite-excel)[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k87.6M276](/packages/barryvdh-laravel-dompdf)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[rap2hpoutre/fast-excel

Fast Excel import/export for Laravel

2.3k24.9M47](/packages/rap2hpoutre-fast-excel)[elibyy/tcpdf-laravel

tcpdf support for Laravel 6, 7, 8, 9, 10, 11

3542.7M5](/packages/elibyy-tcpdf-laravel)[stevebauman/autodoc-facades

Auto-generate PHP doc annotations for Laravel facades

98186.6k9](/packages/stevebauman-autodoc-facades)

PHPackages © 2026

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