- 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.