Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

salioudiabate's avatar

MPDF

HOW I CAN USE MPDF WITH LARAVEL IN MY APPLICATION ?

0 likes
5 replies
iamsagarvaghela's avatar

Hey, @salioudiabate You can use mpdf/mpdf package to easily implement it. Regarding MPDF-related issues, you can reach out to me. I have worked on it.

Steps: install command:

composer require mpdf/mpdf

Controller Changes:

<?php
require_once __DIR__ . '/vendor/autoload.php';

$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML('<h1>Hello world!</h1>');
$mpdf->Output();

And it's done! 👍🏻

Package Link: https://packagist.org/packages/mpdf/mpdf

Please or to participate in this conversation.