I cannot retrieve data from the database to a PDF generated by the dompdf package. The PDF file gets generated, but it is empty. Any ideas?

**invoiceController**

```
public function pdf_print()
{
    $invoices = Invoice::all();

    $pdf = PDF::loadView('invoice.pdf', compact('invoices'));

    return $pdf->download('invoice.pdf');
}

```