PHPackages                             prgayman/laravel-zatca - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. prgayman/laravel-zatca

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

prgayman/laravel-zatca
======================

Laravel package a helper to Generate the QR code and signed it for ZATCA E-invoicing

1.0.0(4y ago)2926.9k—4.2%10[2 issues](https://github.com/prgayman/laravel-zatca/issues)1MITPHPPHP &gt;=7.2|^8.0

Since Dec 12Pushed 3y ago3 watchersCompare

[ Source](https://github.com/prgayman/laravel-zatca)[ Packagist](https://packagist.org/packages/prgayman/laravel-zatca)[ Docs](https://github.com/prgayman/laravel-zatca)[ RSS](/packages/prgayman-laravel-zatca/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (1)

Laravel ZATCA E-invoicing
=========================

[](#laravel-zatca-e-invoicing)

Introduction
------------

[](#introduction)

Laravel package a helper to Generate the QR code and signed it for ZATCA E-invoicing

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

[](#installation)

To get the latest version of laravel-zatca on your project, require it from "composer":

```
$ composer require prgayman/laravel-zatca

```

Or you can add it directly in your composer.json file:

```
{
  "require": {
    "prgayman/laravel-zatca": "1.0.0"
  }
}
```

### Laravel

[](#laravel)

Register the provider directly in your app configuration file config/app.php `config/app.php`:

Laravel &gt;= 5.5 provides package auto-discovery, thanks to rasmuscnielsen and luiztessadri who help to implement this feature in Zatca, the registration of the provider and the facades should not be necessary anymore.

```
'providers' => [
    Prgayman\Zatca\ZatcaServiceProvider::class,
]
```

Add the facade aliases in the same file:

```
'aliases' => [
  'Zatca' => Prgayman\Zatca\Facades\Zatca::class,
]
```

### Lumen

[](#lumen)

Register the provider in your bootstrap app file `boostrap/app.php`

Add the following line in the "Register Service Providers" section at the bottom of the file.

```
$app->register(Prgayman\Zatca\ZatcaServiceProvider::class);
```

For facades, add the following lines in the section "Create The Application" .

```
class_alias(\Prgayman\Zatca\Facades\Zatca::class, 'Zatca');
```

Usage
-----

[](#usage)

### Generate Base64

[](#generate-base64)

```
use Prgayman\Zatca\Facades\Zatca;

$base64 = Zatca::sellerName('Zatca')
            ->vatRegistrationNumber("123456789123456")
            ->timestamp("2021-12-01T14:00:09Z")
            ->totalWithVat('100.00')
            ->vatTotal('15.00')
            ->toBase64();
// Output
// AQVaYXRjYQIPMTIzNDU2Nzg5MTIzNDU2AxQyMDIxLTEyLTAxVDE0OjAwOjA5WgQGMTAwLjAwBQUxNS4wMA==
```

### Generate Plain

[](#generate-plain)

```
use Prgayman\Zatca\Facades\Zatca;

$tlv = Zatca::sellerName('Zatca')
            ->vatRegistrationNumber("123456789123456")
            ->timestamp("2021-12-01T14:00:09Z")
            ->totalWithVat('100.00')
            ->vatTotal('15.00')
            ->toTLV();
```

### Render A QR Code Image

[](#render-a-qr-code-image)

```
use Prgayman\Zatca\Facades\Zatca;
use Prgayman\Zatca\Utilis\QrCodeOptions; // Optional

// Optional
$qrCodeOptions = new QrCodeOptions;

// Format (png,svg,eps)
$qrCodeOptions->format("svg");

// Color
$qrCodeOptions->color(255,0,0,1);

// Background Color
$qrCodeOptions->backgroundColor(0,0,0);

// Size
$qrCodeOptions->size(100);

// Margin
$qrCodeOptions->margin(0);

// Style (square,dot,round)
$qrCodeOptions->style('square',0.5);

// Eye (square,circle)
$qrCodeOptions->eye('square');

$qrCode = Zatca::sellerName('Zatca')
            ->vatRegistrationNumber("123456789123456")
            ->timestamp("2021-12-01T14:00:09Z")
            ->totalWithVat('100.00')
            ->vatTotal('15.00')
            ->toQrCode($qrCodeOptions);
```

### Generate Base64 Using Function

[](#generate-base64-using-function)

```
$base64 = zatca()
            ->sellerName('Zatca')
            ->vatRegistrationNumber("123456789123456")
            ->timestamp("2021-12-01T14:00:09Z")
            ->totalWithVat('100.00')
            ->vatTotal('15.00')
            ->toBase64();
// Output
// AQVaYXRjYQIPMTIzNDU2Nzg5MTIzNDU2AxQyMDIxLTEyLTAxVDE0OjAwOjA5WgQGMTAwLjAwBQUxNS4wMA==
```

### Generate Plain Using Function

[](#generate-plain-using-function)

```
$tlv = zatca()
            ->sellerName('Zatca')
            ->vatRegistrationNumber("123456789123456")
            ->timestamp("2021-12-01T14:00:09Z")
            ->totalWithVat('100.00')
            ->vatTotal('15.00')
            ->toTLV();
```

### Render A QR Code Image Using Function

[](#render-a-qr-code-image-using-function)

```
$qrCode = zatca()
            ->sellerName('Zatca')
            ->vatRegistrationNumber("123456789123456")
            ->timestamp("2021-12-01T14:00:09Z")
            ->totalWithVat('100.00')
            ->vatTotal('15.00')
            ->toQrCode(
              qrCodeOptions()
                ->format("svg")
                ->color(255,0,0,1)
                ->size(300)
            );
```

Testing
-------

[](#testing)

```
composer test
```

Licence
-------

[](#licence)

This library is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity54

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

1619d ago

### Community

Maintainers

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

---

Top Contributors

[![prgayman](https://avatars.githubusercontent.com/u/62302022?v=4)](https://github.com/prgayman "prgayman (6 commits)")

---

Tags

e-invoicinglaravelprgaymanqrcodezatcaqrcodelaravelZATCAe-invoicingprgayman

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/prgayman-laravel-zatca/health.svg)

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

###  Alternatives

[devtical/nova-qrcode-field

Nova QR code field

4560.6k2](/packages/devtical-nova-qrcode-field)[amirezaeb/heroqr

A Powerful QR Code Management Library For PHP

9510.3k](/packages/amirezaeb-heroqr)[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

295.1k](/packages/linkxtr-laravel-qrcode)[akira/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

431.4k](/packages/akira-laravel-qrcode)

PHPackages © 2026

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