greenter/xml
Genera XML UBL 2.0/2.1 para comprobantes electrónicos con Greenter. Ideal para facturas, boletas y otros documentos en formato estándar, listo para integrarse con tus flujos de emisión electrónica. Documentación y soporte en greenter.dev.
greenter/xml package is highly tailored for generating Peruvian SUNAT-compliant electronic invoices (Factura Electrónica) in UBL 2.0/2.1 format. This makes it a strong fit for businesses in Peru (or Latin America) requiring SUNAT validation for tax compliance.composer require) and can be wrapped in a facade/service class for cleaner architecture.FacturaElectronica domain service, abstracting XML generation logic from business layers.Log::channel('xml')) for debugging.Cache::remember) to store pre-generated XML templates.facturas table with xml_content field).Response::stream() for large XML files.GenerateInvoiceJob) for async processing.composer require greenter/xml).app/Services/FacturaElectronicaService) to:
class FacturaElectronicaService {
public function generarFactura(array $datos): string {
$xml = (new \Greenter\Xml\Factura())->generar($datos);
// Validar contra SUNAT schema
$this->validarSchema($xml);
return $xml;
}
}
OrderCreated) to trigger invoice generation.barryvdh/laravel-dompdf.| Step | Task | Dependencies |
|---|---|---|
| 1 | Install package | Composer access |
| 2 | Write PoC service | Package docs |
| 3 | Test against SUNAT sandbox | SUNAT credentials |
| 4 | Build wrapper service | PoC validation |
| 5 | Integrate with business logic | Domain models (e.g., Order) |
| 6 | Add async queue processing | Laravel Queues |
| 7 | Implement SUNAT webhook handling | SUNAT API docs |
stack) for:
facturas table is indexed for fast retrieval.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| SUNAT schema changes | Package breaks | Fork + maintain locally |
| XML generation timeout | Async job fails | Retry with exponential backoff |
| Invalid SUNAT credentials | API calls fail | Cache credentials securely |
| Large payload OOM | Server crashes | Stream XML or increase memory |
| SUNAT webhook downtime | Unprocessed responses | Queue + retry logic |
How can I help you explore Laravel packages today?