Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Twig Excel Bundle

Twig Excel Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

PhpExcel integration for Twig/Symfony

Frequently asked questions about Twig Excel Bundle
Can I use mewesk/twig-excel-bundle in a Laravel application?
No, not as a package install. It is a Symfony bundle that registers a Bundle subclass, publishes Symfony DI service configuration, and relies on the twig.extension service tag — none of which Laravel supports. The only reusable part is the Twig extension class that maps a rendered template to a spreadsheet writer call.
Does Twig Excel Bundle work on PHP 8?
No. The bundle is built on PHPExcel, which does not run cleanly on PHP 7.2+ and breaks outright on PHP 8.x. Any Laravel application on a currently supported PHP version cannot install this dependency graph without forking the spreadsheet engine. That effectively rules it out for modern stacks.
Is PHPExcel still maintained?
No. PHPExcel was deprecated in favour of PhpSpreadsheet and has had no release since 2015. It has no security response path, so vulnerabilities in the spreadsheet parsing layer will not be patched. PhpSpreadsheet is the maintained successor and the correct target for new work.
How do I install mewesk/twig-excel-bundle?
You would normally install it with Composer and register the bundle in a Symfony AppKernel or bundles.php. In Laravel there is no bundle discovery mechanism, so installation gains you nothing at runtime. The repository is also archived, so installation is not recommended even on Symfony.
What is the best Laravel alternative to Twig Excel Bundle?
maatwebsite/excel is the natural default for Laravel: it is actively maintained, sits on PhpSpreadsheet, and uses Blade export views instead of Twig. openspout/openspout is a strong lightweight option for streaming large tabular exports. If you specifically need Twig-based workbook templating, reimplement the bridge on PhpSpreadsheet rather than installing this bundle.
How do I generate Excel files from Twig templates in Laravel?
Extract the bundle's Twig extension class and its token-parser helper into app/Support, then re-point every PHPExcel_* call at the PhpSpreadsheet equivalents such as PhpOffice\PhpSpreadsheet\Writer\Xlsx and IOFactory. Register the extension against whichever Twig environment your application uses, typically via rcrowe/twigbridge or a manually bound Twig\Environment. Skip the bundle's DI config and Symfony version constraints entirely.
Is mewesk/twig-excel-bundle safe to use in production?
No. The repository is archived, has roughly 37 stars and zero dependents, and carries no security response path. The underlying PHPExcel engine is end-of-life and unpatched. There is also no field validation from downstream projects exercising the code path.
Which Laravel and PHP versions does Twig Excel Bundle support?
None officially — it is a Symfony bundle with no Laravel integration at all. Its PHPExcel dependency effectively caps it at unsupported PHP runtimes. Anything on PHP 8.0 or later eliminates it outright.
How do I migrate from PHPExcel to PhpSpreadsheet?
Replace PHPExcel_Writer_* classes with PhpOffice\PhpSpreadsheet\Writer\Xlsx and related writers, and use IOFactory::load($template) to open the workbook template. Set cell values on the worksheet objects, then construct the writer and call save(). The load-template, bind-data, write-file workflow is preserved, so the migration is mostly mechanical class renaming.
Does Twig Excel Bundle support .xlsx templates with placeholder substitution?
Yes — that is its core idea: designers edit a real spreadsheet template, and developers render it from a Twig view with loops and data binding before writing the .xlsx output. The problem is the engine underneath, not the concept. Reimplementing the same workflow on PhpSpreadsheet keeps the benefit without the dead dependency.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core