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.
composer require ismaelw/laratex.php artisan vendor:publish --provider="Ismaelw\LaraTeX\LaraTeXServiceProvider") and review config/laratex.php for the LaTeX binary path (pdflatex/xelatex) and temporary directory.which pdflatex) and that the configured temp directory is writable by the web server user.use Ismaelw\LaraTeX\Facades\LaraTeX;
$pdf = LaraTeX::compile('\documentclass{article}\begin{document}Hello\end{document}');
$pdf->save(storage_path('app/hello.pdf'));
\documentclass{article} document, then move to Blade templates for real reports..tex Blade views in resources/views/latex/ and render them with data before compiling. This keeps LaTeX layout separate from PHP logic and supports loops/conditionals.response()->download($path)->deleteFileAfterSend(true) for one-off invoices or reports.GeneratePdfJob) and notify the user when the PDF is ready. Store the output in storage/app/latex/ and serve via signed URLs.finally block, or use Laravel’s Storage::deleteDirectory() after sending the response.pdflatex must be installed with required packages (e.g., texlive-latex-base, texlive-fonts-recommended). Missing packages produce stderr output that the package may surface as an exception—log the full Process output when debugging.&, %, $, #, _, {, }, ~, ^, \) break compilation. Escape or sanitize user-provided values before injecting them into templates.config/laratex.php, run php artisan config:clear (or config:cache in production) so the new binary/temp paths take effect.try/finally around compilation or a scheduled cleanup command for the temp directory..tex file plus the raw log is usually enough to identify a missing package or syntax error.How can I help you explore Laravel packages today?