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
Opentbs Bundle

Opentbs Bundle Laravel Package

mbence/opentbs-bundle

A Symfony bundle that integrates OpenTBS, the PHP template engine for merging data into OpenOffice and Microsoft Office documents such as docx, xlsx, pptx, and odt files. Generate dynamic reports and documents from templates using simple tags.

View on GitHub
Deep Wiki
Context7

A bundle to use OpenTBS in Symfony - to create OpenOffice and Ms Office documents with PHP.

Frequently asked questions about Opentbs Bundle
Is mbence/opentbs-bundle a Laravel package or a Symfony bundle?
It is a Symfony bundle. It registers through Symfony's Bundle class, a DependencyInjection extension and a config tree, and it ships no Laravel service provider, facade or package auto-discovery metadata. Installing it in a Laravel application gives you a bundle class that nothing will ever boot. Laravel teams should require the underlying OpenTBS and TinyButStrong library directly and wrap it in a small service provider.
How do I generate docx or xlsx files from a template in a Laravel application?
Require the upstream OpenTBS and TinyButStrong library with Composer and write a small service class that instantiates TinyButStrong with the OpenTBS plugin, loads a docx or xlsx template, merges your data array through MergeField and MergeBlock, and calls Show with the download or file option. Bind that class in a Laravel service provider and inject it wherever documents are needed. Run heavy generation inside a queued job and write the output to a Storage disk so you never block a request.
What document formats can OpenTBS generate?
OpenTBS merges data into OpenDocument and Office Open XML templates: docx, xlsx, pptx, odt, ods and odp. It manipulates the template's ZIP container and XML parts directly, so no LibreOffice or Microsoft Office installation is required on the server. It does not produce PDF, which needs a separate renderer such as headless LibreOffice.
Does mbence/opentbs-bundle support Laravel 10 or 11 and PHP 8?
There is no Laravel integration at all, so Laravel version support is not really the issue since nothing in the bundle gets booted. The bundle's last release was September 2016 and the code is PHP 5-era, so expect deprecation warnings and breakage on PHP 8.x around dynamic properties, implicit nullable parameters and removed functions. If you use the underlying library, budget time to pin a PHP version or patch compatibility issues yourself.
Is mbence/opentbs-bundle still maintained and safe to use in production?
It has been unmaintained since 2016, with roughly 26 GitHub stars and no dependents, so there is no community to inherit fixes from. Any vulnerability in the ZIP or XML handling path becomes yours to patch. Treat it as a legacy dependency decision and prefer the upstream library or a maintained alternative for new work.
OpenTBS vs PHPWord and PhpSpreadsheet: which should I use in Laravel?
PHPWord and PhpSpreadsheet are actively maintained, well documented and widely used in Laravel projects, but you build documents programmatically or from templates in code. OpenTBS keeps the template as a real docx or xlsx file that business users can edit using tags like [var] and [b.block], which is its main advantage. If non-developers must own templates, OpenTBS wins; if you want support and ecosystem familiarity, PHPWord and PhpSpreadsheet are safer.
Can OpenTBS generate PDF files?
No. OpenTBS produces docx, xlsx, pptx, odt, ods and odp only. For PDF you need a second step such as headless LibreOffice converting the generated file, or a commercial rendering service, which materially changes your architecture and infrastructure.
How do I handle user-uploaded templates safely with OpenTBS?
Document generation means parsing ZIP containers and XML, so untrusted templates are an attack surface for XXE, zip bombs and entity expansion. Validate and size-limit uploads, disable external entity loading in libxml, cap decompressed size, and generate inside an isolated queue worker. Do not rely on the library's defaults for hardening.
What license does OpenTBS use, and can I use it in a closed-source SaaS?
TinyButStrong and OpenTBS carry LGPL-family terms, which have distribution implications if you ship the library inside a closed-source product. Running it server-side in a SaaS is generally a different scenario from redistributing it in a desktop application, but you need legal review before adopting. Verify the exact license text of the version you pin.
How do I test OpenTBS document generation in Laravel?
Fake the Storage disk, run the generator, then assert the file exists and that its contents unzip to the expected XML parts using ZipArchive. Assert on a handful of merged values rather than byte-for-byte output, since templates and XML ordering change often. Keep template fixtures in a tests/Fixtures directory and version them like source code.
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.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package