Hello everyone, in this post, i will share how to fix recent PDF error in your laravel 5,6,7,8, & 9 project.
If you face this error, you should follow below instructions.
Step-1 :
Delete composer.json file from project. After deleting composer.json file, you need to install latest pdf package
Step-2:
Install the latest version of mPDF. Run below command-
composer require mpdf/mpdf
After running this command, you need to update composer.
If your Laravel project below 5.5, you need to manually add provider and aliases:
Step-3:
'providers' => [
Mccarlosen\LaravelMpdf\LaravelMpdfServiceProvider::class,
],
.
.
.
.
'aliases'=>[
'PDF' => Mccarlosen\LaravelMpdf\Facades\LaravelMpdf::class,
],
Step-4:
composer update
I hope, you will fixed your issue if you followed this instructions.
Thank you for your time.