barryvdh / laravel-dompdf

A DOMPDF Wrapper for Laravel
MIT License
6.66k stars 966 forks source link

Fix named arguments when using facade #921

Closed michael-rubel closed 11 months ago

michael-rubel commented 1 year ago

About

Named arguments don't work when using facade because of hardcoded args in __callStatic()


Reproduce the problem:

Pdf::loadView('pdf.report', [
    ...
], encoding: 'UTF-8')->output();

Then we get:

error


I've removed the magic method and the named arguments now work as expected, but I'm wondering if there was a special reason to add this code? All tests pass after the change:


scr


barryvdh commented 1 year ago

I think there was a reason for this. But not 100% sure, probably with regards to multiple instances.

erikn69 commented 11 months ago

@michael-rubel hi, try #1002, I made another approach