niklasravnsborg / laravel-pdf

📄 Laravel PDF
709 stars 213 forks source link

error in laravel 9 #223

Open progintYasin opened 2 years ago

progintYasin commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

Cheers,

Eric

shykot75 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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