Download the PHP package saudizatca/laravel-zatca without Composer
On this page you can find all versions of the php package saudizatca/laravel-zatca. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download saudizatca/laravel-zatca
More information about saudizatca/laravel-zatca
Files in saudizatca/laravel-zatca
Package laravel-zatca
Short Description Complete Laravel package for ZATCA (Saudi Arabia) E-Invoicing Phase 2 integration - Supports Sandbox, Simulation, and Production environments
License MIT
Informations about the package laravel-zatca
ZATCA E-Invoicing Laravel Package
Complete Laravel package for ZATCA (Saudi Arabia) E-Invoicing Phase 2 integration. Supports all three environments: Sandbox, Simulation, and Production.
Features
- Certificate Management: CSR generation with secp256k1 ECC keys
- Compliance CSID: Request compliance certificates from ZATCA
- Production CSID: Request production certificates after passing compliance
- Invoice Generation: UBL 2.1 compliant XML for all invoice types
- Digital Signing: ECDSA SHA-256 signatures (XAdES-BES)
- QR Code Generation: ZATCA TLV format (Phase 1 & Phase 2)
- Invoice Submission: Reporting (B2C) and Clearance (B2B)
- Credit/Debit Notes: Full support for invoice adjustments
- Arabic Support: Bilingual invoice support
- Multi-Environment: Sandbox, Simulation, and Production
- Comprehensive Logging: Detailed logging of all operations
- Database Storage: Track all invoices and certificates
- Full Test Coverage: Unit and Feature tests included
Requirements
- PHP 8.1+
- Laravel 10.x / 11.x / 12.x / 13.x
- OpenSSL extension with EC support
- GMP extension (recommended)
- ext-dom, ext-mbstring, ext-json, ext-xmlwriter, ext-curl
Installation
Publish configuration:
Run migrations:
Configuration
Add to your .env file:
Quick Start
1. Check Status
2. Generate CSR
3. Request Compliance CSID
Get OTP from ZATCA portal, then:
4. Request Production CSID (after compliance tests pass)
5. Submit Invoices
Programmatic Usage
Generate CSR
Create and Submit Invoice
Generate QR Code (Phase 1 - Basic)
Working with Existing XML
Invoice Types
| Type | Description | Submission Method |
|---|---|---|
standard |
B2B Tax Invoice | Clearance (real-time) |
simplified |
B2C Simplified Invoice | Reporting (within 24h) |
credit_note |
Credit Note | Clearance |
debit_note |
Debit Note | Clearance |
Artisan Commands
| Command | Description |
|---|---|
zatca:status |
Check integration status |
zatca:csr |
Generate CSR |
zatca:compliance-csid |
Request compliance CSID |
zatca:production-csid |
Request production CSID |
zatca:report |
Submit simplified invoice |
zatca:clear |
Submit standard invoice |
zatca:validate |
Validate XML or QR code |
Database Models
ZatcaCertificate
Stores certificate information:
ZatcaInvoice
Tracks all invoices:
ZatcaLog
Detailed operation logs:
Environments
Sandbox
- For initial development and testing
- Uses ZATCA Developer Portal
- Pre-configured test credentials
Simulation
- Pre-production testing
- Requires real CSID from compliance
- Tests with real API structure
Production
- Live environment
- Requires production CSID
- Real invoice submission
Testing
Run the test suite:
Test Structure
Error Handling
All exceptions extend ZatcaException:
Logging
Configure logging in config/zatca.php:
Add to config/logging.php:
Security
- Never commit
.envfiles with real credentials - Use
log_sensitive_data: falsein production - Store certificates securely (storage path should be outside web root)
- Rotate certificates before expiry
- Use HTTPS for all API communications in production
Troubleshooting
Certificate Issues
API Connection Issues
Contributing
- Fork the repository
- Create a feature branch
- Write tests for new functionality
- Ensure all tests pass
- Submit a pull request
License
This package is open-sourced software licensed under the MIT license.
Support
For issues and feature requests, please use the GitHub issue tracker.
References
All versions of laravel-zatca with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/console Version ^10.0|^11.0|^12.0|^13.0
ext-openssl Version *
ext-dom Version *
ext-mbstring Version *
ext-json Version *
ext-gmp Version *
ext-xmlwriter Version *
ext-curl Version *
ext-zip Version *