barryvdh / laravel-dompdf

A DOMPDF Wrapper for Laravel
MIT License
6.62k stars 965 forks source link

Laravel config.php ignored? #1000

Closed IceEcold1 closed 11 months ago

IceEcold1 commented 11 months ago

Describe the bug When using dd() on any PDF::loadView()->getOptions() it looks like the default config dompdf.php values are loaded instead of the published config/dompdf.php values. Thing to watch is the chroot, which should be /var/www/html (working in a linux based docker) but shows /var/www/html/vendor/dompdf/dompdf. Changing the value by using getOptions()->setChroot(realpath(base_path()) actually shows the correct path after dd() and changes the way the PDF is rendered.

Below the standard snippet provided by publishing the config. ` /**

To Reproduce Steps to reproduce the behavior: Laravel 10 with DOMPDF 2.0.1

Reproducable by running php artisan vendor:publish --provider="Barryvdh\DomPDF\ServiceProvider" and dd(PDF::loadView(any blade.php)->getOptions()), all values should be default instead of the published values.