barryvdh / laravel-dompdf

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

when I try to PDF loadView it show me error! #939

Open joypaul1 opened 1 year ago

joypaul1 commented 1 year ago

#Here Is my simple code .

$data = ['title' => 'Welcome to HDTuto.com']; return $pdf= PDF::loadView('welcome', compact('data'));

Capture

### it was return this kind of error !!

ymfony\Component\HttpFoundation\Response::setContent(): Argument #1 ($content) must be of type ?string, Barryvdh\DomPDF\PDF given, called in F:\icicle\mid_east\vendor\laravel\framework\src\Illuminate\Http\Response.php on line 72.

erikn69 commented 1 year ago

return $pdf= PDF::loadView('welcome', compact('data'));

Why?? just return $pdf= PDF::loadView('welcome', $data);

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/dompdf/dompdf instead. When having doubts, please try to reproduce the issue with just dompdf. If you believe this is an actual issue with the latest version of laravel-dompdf, please reply to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.