Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

error in laravel 9 #223

Open
progintYasin opened this issue Mar 26, 2022 · 10 comments
Open

error in laravel 9 #223

progintYasin opened this issue Mar 26, 2022 · 10 comments

Comments

@progintYasin
Copy link

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

@ericlaaper
Copy link

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

@Haghghii
Copy link

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

@ericlaaper
Copy link

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

Cheers,

Eric

@shykot75
Copy link

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.

@mimosu
Copy link

mimosu commented Sep 21, 2022

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

@chris-gassner
Copy link

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.

@ericlaaper
Copy link

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

@Nelio-Bila
Copy link

Nelio-Bila commented Nov 22, 2022

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

@ericlaaper
Copy link

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

@Nelio-Bila
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants