Hello,
Please note that https://github.com/barryvdh/laravel-dompdf is a wrapper for calling some DOMPDF methods. phpdocx requires using DOMPDF directly, so we recommend you use https://github.com/dompdf/dompdf.
To use a wrapper such as https://github.com/barryvdh/laravel-dompdf, you'd need to get the Dompdf instance. For example, using the getDomPDF method from this library, and then pass it to the phpdocx method. We recommend you use https://github.com/dompdf/dompdf.
Regards.