vel/mpdf-bundle
vel/mpdf-bundle integrates the mPDF library into Laravel, providing bundle-style configuration and service provider wiring for generating PDFs from HTML. It aims to simplify PDF output in Laravel apps, but adoption and community activity are very limited.
Architecture fit
vel/mpdf-bundle), description, and repository (astterx/MpdfBundle) all indicate a Symfony Bundle — a class extending Symfony\Component\HttpKernel\Bundle\Bundle plus a DI Extension and Configuration class. Laravel has no bundle-registration mechanism; it uses Illuminate\Support\ServiceProvider with package discovery via extra.laravel.providers in composer.json. Neither will be present here.mPDF as a container service and injects a KernelInterface-derived cache/temp path. Under Laravel we would not use the Symfony container semantics, the bundle registration, the Configuration tree, or the kernel-aware path resolution. What remains is a thin factory around mpdf/mpdf — roughly a service provider and a singleton binding that any Laravel engineer writes in under an hour.mpdf/mpdf is a mature, framework-agnostic, PHP-library-first PDF renderer. It integrates cleanly into Laravel without any Symfony bridge. Adopting the bundle to get mPDF is a transitive-dependency decision disguised as a package decision.Integration feasibility
composer require the package, skip bundle registration, and manually instantiate the wrapper class. But that class will almost certainly type-hint Symfony interfaces (ContainerInterface, KernelInterface, ConfigCacheFactoryInterface) that Laravel does not bind, forcing us to build adapter bindings purely to satisfy a wrapper we don't need.symfony/framework-bundle and symfony/http-kernel to older major versions. Installing alongside a modern Laravel skeleton (which pulls its own Symfony components for console, HTTP foundation, and process at current major versions) risks a Composer conflict or forces us to pin Symfony components backwards — a change with blast radius across the whole application.Technical risk
mpdf/mpdf constraint will hold us on a vulnerable transitive version, and we cannot patch it without forking.vel) that is not obviously the author's own GitHub org (astterx). Before any adoption we would need to review the commit history, CI status, and whether releases are tagged and signed.Key questions
composer.json declare, and does composer why-not resolve cleanly against the target Laravel skeleton?mpdf/mpdf version does it pin, and is that version within the currently supported security window?Stack fit
mpdf/mpdf directly and write a first-party Laravel service provider. The wrapper supplies no capability that survives the port to Laravel, and it introduces a Symfony-framework dependency into a stack that should not carry one.composer require mpdf/mpdf, then a small internal package (or app/Support/Pdf) containing: a MpdfServiceProvider registering a singleton factory, a config/pdf.php with font directory, temp directory, and default paper size/orientation, and a thin PdfRenderer contract so tests can swap a fake. This is the standard, boring, and correct approach.tempDir and fontDir at storage/app/mpdf, not at the vendor directory (which is read-only in most container builds) and not at the system /tmp (which is often size-capped and shared).Migration path
mpdf/mpdf integration.Compatibility
php constraint. A bundle with this adoption profile frequently caps below current PHP minors; if so, it cannot run on a current Laravel release at all and the decision is closed.composer require vel/mpdf-bundle --dry-run in a scratch copy of the target skeleton before spending any further evaluation time.Sequencing
storage/app/mpdf paths, a PdfRenderer interface, and one feature test asserting a non-empty PDF with a known magic header.Maintenance
mpdf/mpdf) that is widely used and actively maintained, versus two (mpdf/mpdf plus an unmaintained bridge) where the bridge constrains our ability to patch the underlying library. Every wrapper is a version ceiling; this wrapper's ceiling is low.Support
Scaling
tempDir must point at a writable, per-worker path with cleanup, or concurrent renders will collide on temp filenames.Failure modes
Target [Symfony\...\KernelInterface] is not instantiable when the wrapper's constructor type-hints go unsatisfied. Symptomatic of the architectural mismatch; not worth patching around.mpdf/mpdf and we inherit unfixed upstream issues without any visible signal.tempDir or fontDir cannot be written. Fails loudly in dev, silently or partially in a read-only container under load.memory_limit. Mitigate with a hard page/document cap and a queue with a raised limit.echo.Ramp-up
<htmlpageheader>, page-break control, and font configuration. That learning transfers to any project; learning this wrapper does not.Bottom line for the decision record: vel/mpdf-bundle is a low-adoption, likely unmaintained Symfony bundle whose only substantive function — registering mPDF in a DI container — does not transfer to Laravel. Reject it, adopt mpdf/mpdf directly behind a first-party Laravel service provider, and revisit only if the renderer requirement turns out to be something mPDF handles poorly.
How can I help you explore Laravel packages today?