ismaelw/laratex
Laratex is a Laravel package for generating PDFs with LaTeX. Write templates as Laravel views, compile them through a configurable LaTeX engine, and produce polished documents directly from your application.
Architecture fit. laratex is a thin Laravel wrapper that shells out to a LaTeX toolchain via Symfony Process to render PDFs from Blade-ish templates. It fits applications that need high-fidelity typeset documents (invoices, statements, academic-style reports, labels) where HTML-to-PDF fidelity is a recurring pain point. It does not fit stateless/serverless runtimes, read-only container filesystems, or environments where arbitrary binary execution is prohibited. Architecturally it is a peripheral rendering dependency, not a core domain concern — treat it as an adapter behind an internal DocumentRenderer interface so it can be swapped for DomPDF/wkhtmltopdf/Gotenberg without touching business logic.
Integration feasibility. Low code-level effort: Composer install, optional config publish, one facade/service call. The real cost is environmental, not PHP: a TeX distribution (TeX Live, several hundred MB to multiple GB with fonts) must exist in every runtime that renders documents — local, CI, queue workers, and production images. That is a container/image change, not a composer require.
Technical risk. Moderate, and concentrated in the supply chain rather than the API surface:
v1.3.0-p1 while the changelog references v1.3.1 as the version where older Laravel support is dropped is confusing. Constraint ranges (^1.3) will pick up whichever sorts higher under Composer's normalization; the team must verify which artifact CI actually resolves before pinning.Process constructor — a workaround for Symfony Process behavior on older Laravel/Symfony versions. It implies an implicit compatibility matrix (Laravel ↔ Symfony Process ↔ PHP) that is not documented in the release note..tex source, \write18/\input shell-escape risks and path traversal via \input become security concerns, not just quality concerns.Key questions.
Process matrix, and is 1.3.0-p1 intended for teams that cannot move to 1.3.1?Stack fit. Good for a Laravel monolith on VMs or long-lived containers with writable local storage and queue workers. Poor for Lambda/Cloud Run-style deployments, and poor where a managed HTML-to-PDF SaaS is already contracted.
Migration path. Do not replace an existing PDF path wholesale. Sequence:
composer show the resolved tag, confirm 1.3.0-p1 vs 1.3.1).LatexRenderer alongside the incumbent. Templates live in the repo and are owned by the product team, not by the package.Compatibility. Pin the exact patch version rather than floating ^1.3 until the 1.3.0-p1/1.3.1 relationship is confirmed. Verify no conflict with the app's symfony/process constraint — the very existence of this patch suggests tight coupling there. Confirm PHP and Laravel minimums against the app's oldest supported deployment target, not just the newest.
Sequencing. Container/toolchain image → dependency + adapter → CI job that compiles a golden-set document and asserts non-empty, page-count-stable output → staging → production behind flag. The image work gates everything; schedule it first because it usually needs platform/DevOps sign-off and increases image size materially.
Maintenance. Low ongoing code maintenance, but non-zero ownership: pinned version, a private container image carrying TeX Live, and a template library that someone must own. Budget for periodic TeX Live upgrades independent of the Laravel upgrade cadence — two upgrade tracks instead of one.
Support. Upstream is community-supported by a small maintainer base; expect to self-diagnose. Establish an internal runbook covering missing binaries, missing .sty packages, font availability, and permission errors on the temp directory — the exact area this patch touches.
Scaling. Compilation is CPU-bound and slow (typically hundreds of milliseconds to several seconds per document). It must run on queue workers, never in the request cycle. Scaling is horizontal worker count, which is a cost line item distinct from web traffic. Watch temp-disk consumption: concurrent jobs each need their own working directory, and leaked temp dirs are a slow-burn disk exhaustion risk.
Failure modes.
Process failures that pass CI and fail in production.Ramp-up. The PHP side is a day. The LaTeX side is the real learning curve: template authoring, escaping rules, debugging opaque TeX error logs, and page-layout iteration. Assume one engineer becomes the de facto LaTeX owner and protect that knowledge with documentation and golden-file tests. For a team with no LaTeX experience, validate the choice against a headless-Chrome or Gotenberg alternative before committing to this dependency — the patch release itself is unremarkable, but the operational surface it commits you to is not.
How can I help you explore Laravel packages today?