mewesk/twig-spreadsheet-bundle
A Symfony bundle that brings Twig templating to spreadsheet generation, letting you design XLSX, CSV, and other spreadsheet files with familiar Twig syntax instead of low-level APIs. Build clean, reusable templates for reports and exports, keep layout logic separate from PHP code, and render dynamic...
Architecture fit — poor, with a naming trap. Despite the request framing, this is not a Laravel package. mewesk/twig-spreadsheet-bundle is a Symfony bundle: it registers a DI extension, a spreadsheet service, and a Twig extension that exposes spreadsheet primitives (sheets, cells, styles, writers, response factory) as Twig functions/filters. Laravel has no bundle kernel, no Extension/CompilerPass hook, and no Twig as its default view engine. The value proposition — authoring spreadsheet layouts in a template rather than in PHP — is real and demonstrably useful for report-heavy products, but it is delivered through a Symfony-shaped integration we would have to rebuild.
Integration feasibility. Direct composer require will fail or require --ignore-platform-reqs: the 2018 release line targets PHP 7.x, Symfony 3.4/4.x, Twig 1/2, and early PhpSpreadsheet ^1.0. A modern Laravel (10/11, PHP 8.2/8.3) runs PhpSpreadsheet ^2/^3/^4. Two viable paths:
rcrowe/twigbridge so Twig exists in Laravel, then reimplement the bundle's service definitions as a Laravel service provider, re-register the Twig extension, and re-target the PhpSpreadsheet API surface (writer/response APIs changed materially since 1.0).maatwebsite/excel, which is actively maintained and Blade-friendly.Technical risk. High and concentrated in abandonment: archived repo, last release 2018-07-29, 22 stars, 0 dependents, no security-response path. Abandoned code that ingests/emits .xlsx sits on a parser with a real CVE history (XML external entity handling, zip/stream handling, formula injection in generated files). Pin-and-freeze is not a mitigation for a file-format parser. Secondary risks: API drift against modern PhpSpreadsheet, no PHP 8.3 typing guarantees, no Laravel queue/streamed-response idioms, and an implicit "Twig sandbox" question if template content is ever user-influenced.
Key questions for the team.
Stack fit. Misaligned at every layer: Symfony bundle → Laravel service provider; Twig → Blade; PHP 7.x → PHP 8.2+; PhpSpreadsheet ^1.0 → ^2/^3. Only the license (MIT) and the underlying engine (PhpSpreadsheet) fit cleanly.
Migration path (recommended, capability-first).
rcrowe/twigbridge and a SpreadsheetServiceProvider that mirrors the bundle's extension registration. Isolate behind a feature flag; do not let Twig reach business logic.Compatibility notes. If a fork is unavoidable, fork under our org, bump constraints to PHP ^8.2 / PhpSpreadsheet ^2|^3 / Twig ^3, drop Symfony DI in favor of a Laravel provider, and pin with a maintained-branch policy. Budget 3–5 days for the fork to boot, plus ongoing ownership.
Sequencing. Pilot on the lowest-risk, highest-visibility report first (one exporter, one golden-file suite). Prove parity before touching finance/regulatory outputs. Run both paths in parallel for one release cycle behind a config flag, then retire. Do not start with the largest workbook — PhpSpreadsheet memory profile will confound the comparison.
Maintenance. Zero upstream. No patches, no PHP minor-version support, no PhpSpreadsheet security advisories reaching us. Every fix becomes internal engineering time; every transitive CVE becomes an internal triage event with no vendor to lean on. Contrast with maatwebsite/excel or direct PhpSpreadsheet, both actively released.
Support. No community, no issue triage, 22 stars and zero dependents means effectively no peer base to search for answers. Support cost lands entirely on the owning squad; expect Twig + Symfony DI literacy to be a prerequisite for anyone touching it, which narrows the on-call pool.
Scaling. PhpSpreadsheet is memory-bound, not CPU-bound. Large workbooks routinely exhaust PHP memory limits and are unsuitable inline in a request. The bundle predates Laravel's queue and streamed-download idioms, so we get none of the "dispatch a job, stream the result" ergonomics for free — we would build that ourselves regardless. Plan for job-based generation, temp-disk spooling, and chunked writers for anything over a few thousand rows.
Failure modes.
Ramp-up. Expect 3–5 days for a mid-level engineer to be productive in the bundle's template idioms, plus 1–2 days for the Symfony DI/extension wiring, plus Twig onboarding if absent. That is a real cost paid against an abandoned dependency — a poor return when a native exporter is roughly the same ramp with a maintained engine underneath.
TPM recommendation. Do not adopt as a runtime dependency. Adopt as a design reference: the declarative, template-driven spreadsheet layout idea is the genuinely interesting part, and the 6.9 opportunity score plausibly reflects that niche. Capture it by building a thin Laravel-native layout layer over current PhpSpreadsheet (or Laravel Excel), gated by golden-file parity tests, and close the archive risk out entirely on a 3–4 week horizon.
How can I help you explore Laravel packages today?