laravel-pdf icon indicating copy to clipboard operation
laravel-pdf copied to clipboard

error in laravel 9

Open progintYasin opened this issue 2 years ago • 10 comments

i use this package in laravel 8.x and dont have any problem

but in laravel 9 i have this error when i want download pdf file with LoadView method

Declaration of Mpdf\Mpdf::setLogger(Psr\Log\LoggerInterface $logger) must be compatible with Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger): void

progintYasin avatar Mar 26 '22 11:03 progintYasin

Hi someone found a solution that works for me

https://serveanswer.com/questions/that-how-to-fix-laravel-pdf-logerror

Can not oversee the consequences but it works Cheers,

Eric

ericlaaper avatar Apr 07 '22 23:04 ericlaaper

Hi someone found a solution that works for me

https://serveanswer.com/questions/that-how-to-fix-laravel-pdf-logerror

Can not oversee the consequences but it works Cheers,

Eric

This solution did not work

Haghghii avatar Jun 12 '22 05:06 Haghghii

Sorry for you. For me it works like a charm. Did you clear your cache and terminate horizon (if used).

Cheers,

Eric

ericlaaper avatar Jun 12 '22 19:06 ericlaaper

Hi someone found a solution that works for me

https://serveanswer.com/questions/that-how-to-fix-laravel-pdf-logerror

Can not oversee the consequences but it works Cheers,

Eric

Thanks a Lot. It worked for me.

shykot75 avatar Jun 14 '22 08:06 shykot75

Downgrade psr/log to 2.0 instead of 3.0. Because Mpdf (https://packagist.org/packages/mpdf/mpdf) does not support psr/log 3.0

mimosu avatar Sep 21 '22 10:09 mimosu

The serveranswer link did not work me but a cached page was available. For anyone wondering the solution on the page was

composer remove niklasravnsborg/laravel-pdf
composer remove mpdf/mpdf
composer remove psr/log
composer require psr/log=v2.*
composer require mpdf/mpdf v8.0.17
composer require niklasravnsborg/laravel-pdf

Fixed the issue for me.

chris-gassner avatar Sep 30 '22 09:09 chris-gassner

Eric @chris-gassner Hi Chris,

Great, you found a cache. I needed the solution for another project and couldn't find the code anymore. You helped met out! Thanks a lot. Also learned a lesson. Copy the solution, not only the link. 😀 Cheers,

Eric

ericlaaper avatar Sep 30 '22 11:09 ericlaaper

Hi someone found a solution that works for me

https://serveanswer.com/questions/that-how-to-fix-laravel-pdf-logerror

Can not oversee the consequences but it works Cheers,

Eric

This link is not active anymore, how can I find the solution

Nelio-Bila avatar Nov 22 '22 18:11 Nelio-Bila

as above composer remove niklasravnsborg/laravel-pdf composer remove mpdf/mpdf composer remove psr/log composer require psr/log=v2.* composer require mpdf/mpdf v8.0.17 composer require niklasravnsborg/laravel-pdf

ericlaaper avatar Nov 23 '22 01:11 ericlaaper

as above composer remove niklasravnsborg/laravel-pdf composer remove mpdf/mpdf composer remove psr/log composer require psr/log=v2.* composer require mpdf/mpdf v8.0.17 composer require niklasravnsborg/laravel-pdf

Thank you it works like a charm, only thing I had to adjust is the composer require psr/log=v2.* to composer require psr/log:^2.0

Nelio-Bila avatar Nov 23 '22 02:11 Nelio-Bila