Skip to content

Laravel helper to generate the QRcode for ZATCA E-Invoicing system

License

Notifications You must be signed in to change notification settings

mPhpMaster/laravel-zatca

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel-ZATCA

Unofficial package to implement ZATCA QRcode for E-Invoicing.

Requirements

  • PHP >= 7.4
  • An mbstring extension

Dependencies

Installation

Via composer:

$ composer require mphpmaster/laravel-zatca

Usage

Generate Base64

$value = \MPhpMaster\ZATCA\TagBag::make()
    ->setCompany('Company name')
    ->setVatId('311111111111113')
    ->setInvoiceDate('2023-11-24T03:48:00Z')
    ->setInvoiceTotalAmount('100')
    ->setVatAmount('15')
    ->toBase64();

// > Output
// AQxDb21wYW55IG5hbWUCDzMxMTExMTExMTExMTExMwMUMjAyMy0xMS0yNFQwMzo0ODowMFoEAzEwMAUCMTU=

Generate Plain

$value = \MPhpMaster\ZATCA\TagBag::make()
    ->setCompany('Company name')
    ->setVatId('311111111111113')
    ->setInvoiceDate('2023-11-24T03:48:00Z')
    ->setInvoiceTotalAmount('100')
    ->setVatAmount('15')
    ->toTLV();

Get The QRCode Image

$value = \MPhpMaster\ZATCA\TagBag::make()
    ->setCompany('Company name')
    ->setVatId('311111111111113')
    ->setInvoiceDate('2023-11-24T03:48:00Z')
    ->setInvoiceTotalAmount('100')
    ->setVatAmount('15')
    ->toImage();

// <img src="$value" alt="ZATCA QRCode" />

Testing

vendor/bin/phpunit

Copyright and license

Copyright © 2023 hlaCk (https://github.com/mPhpMaster)

Licensed under the MIT License (https://github.com/mPhpMaster/laravel-zatca/blob/master/LICENSE) license.


Stand with Palestine 🇵🇸 #FreePalestine

About

Laravel helper to generate the QRcode for ZATCA E-Invoicing system

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages