nfephp-org/sped-da
Biblioteca PHP para gerar PDFs de documentos auxiliares do Sped (DANFE, DACTE, DAMDFE) a partir de XML, baseada nas classes legadas do NFePHP. Foco em conformidade SEFAZ, simplicidade e escopo genérico, sem customizações de sistema.
nfephp-org/sped-da package is tailored for generating Sped (Sistema Público de Escrituração Digital) auxiliary documents, specifically for Brazilian tax compliance (e.g., NF-e, CT-e, Sped Fiscal, Sped Contribuições). This aligns well with:
SimpleXMLElement or DOMDocument under the hood—compatible with Laravel’s HTTP clients for file uploads/downloads.SpedDocumentGenerator).sped:generate job).| Risk Area | Assessment | Mitigation |
|---|---|---|
| Deprecation Risk | Last release: 2021-05-12 (3+ years stale). No active maintenance. | Fork the repo or engage the community to adopt it under a new org (e.g., laravel-sped). |
| Schema/Standard Drift | Brazilian tax laws evolve (e.g., Sped 4.0+ updates). Package may lag. | Abstract Sped logic behind an adapter pattern to swap implementations. |
| XML Complexity | Sped files are large/complex (e.g., 100MB+ for fiscal books). | Use Laravel’s file streams or chunked processing for memory efficiency. |
| Error Handling | Sped validation errors are verbose (e.g., XML schema violations). | Build a dedicated Sped exception handler (e.g., SpedValidationException). |
| Testing | No built-in test suite; Sped compliance requires mocking Brazilian tax APIs. | Use Pest/Laravel to test edge cases (e.g., invalid XML, missing fields). |
memory_limit=128M) suffice?spedfiscal/sped) been evaluated? Could a composite solution (e.g., this package + another) work?SpedDocumentGenerator::class).Sped::generateFiscalBook()).sped:generate job with sped:validate job).app/Services/SpedService.php).class SpedService {
public function generateFiscalBook(array $data): string {
$generator = new \SpedDA\FiscalBookGenerator($data);
return $generator->generate();
}
}
OrderShipped → generate NF-e).@daily generateSpedFiscalBook).phpunit/phpunit@^9.5.extension=dom and extension=simplexml are enabled in php.ini.sped_logs table.php artisan sped:generate).yourcompany/sped-da) and assign a maintainer.composer.json to avoid breakage.SpedGeneratorInterface).spedfiscal/sped).How can I help you explore Laravel packages today?