Support for laravel livewire? #154
Replies: 1 comment
-
The error Based on the code you provided, it seems you're trying to generate a PDF using the use Spatie\Pdf\Pdf;
use Spatie\Pdf\Dompdf;
public function render()
{
$data = [...]; // Your data
$pdf = Pdf::loadView('livewire.print.card', compact('data'))
->setPaper('a6')
->output();
return $pdf->download('datacard.pdf');
} Explanation:
Alternatively, if you want to return the PDF as a response instead of downloading it, you can use Make sure you have installed the If you're still facing issues, you can try updating the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I tried to generate a pdf inside the laravel livewire render function and it showed the error:
Call to undefined method Spatie\LaravelPdf\PdfBuilder::with()
I have tried both the Pdf class and the pdf function. This is the code inside my livewire render component:
Beta Was this translation helpful? Give feedback.
All reactions