mewesk/twig-excel-bundle
Twig Excel Bundle brings Twig templating to spreadsheet generation, letting you build Excel workbooks from familiar template files instead of verbose PHP code. Define layouts, loops, and data binding in Twig, then export clean .xlsx reports directly from your Symfony application.
.xlsx, so non-engineers (ops, finance) can own the layout of a report while engineers own the data binding — is a genuine product decision worth making. This package is evidence the pattern is desirable; it is not itself the answer.PhpSpreadsheet.Adoption criteria — all of these must be true, and in practice the fourth will fail:
Reality check: even in a Symfony shop, condition 3 or 4 usually kills it.
Look elsewhere when:
maatwebsite/excel — it has the Blade/export-view templating, queued exports, chunked reads, and an active maintainer base. This is a straight substitution, not a workaround.openspout/openspout streams rows with constant memory for large exports where the browser or queue worker would otherwise OOM.PhpSpreadsheet against a pre-built .xlsx skeleton checked into your repo, load it, fill named ranges, and save. Keeps the layout in a file the business can edit; keeps the code testable.Recommendation: do not adopt. Adopt the pattern, not the package.
For executives: We evaluated an open-source library for generating formatted Excel reports from templates. It solves a real user need — letting finance and ops shape their own report layouts — but it is built on PHPExcel, which has been end-of-life since 2019, the repository is archived, and nothing else in the ecosystem depends on it. Using it would mean we inherit maintenance for a component with no upstream support. Estimated cost of ownership outweighs a few weeks of build.
For engineering: The concept is sound — Twig (or Blade) template → xlsx — and the repo is worth reading as a design reference for how to map template constructs onto workbook cells, styles, and formulas. The implementation is not viable: Symfony-only, PHPExcel-bound, unmaintained, zero dependents, single author, archived.
The ask: Approve roughly one sprint to build a thin export module on maatwebsite/excel (Laravel) or PhpSpreadsheet + a checked-in .xlsx template (Symfony), guarded by golden-file tests so layout regressions are caught in CI. This gives us the same capability with an actively maintained dependency, lets the business edit layouts without a deploy, and avoids a fork-from-day-one liability.
Risk if we defer: Low. maatwebsite/excel and PhpSpreadsheet already cover this; the only thing we'd lose is the template-abstraction convenience, which is exactly the part worth building ourselves.
How can I help you explore Laravel packages today?