Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Dirk313's avatar

DOMPDF: Method Illuminate\Database\Eloquent\Collection::stream does not exist.

HI Everyone, So i have started to experiment with DOMPDF and worked at first with just a plain Laravel 9 application, So when i added it to an exiting application with Craftable (General Admin Generator) i get this following error Method Illuminate\Database\Eloquent\Collection::stream does not exist. so im not sure if its a compatibility issue or what and googled for a solution and trying to figure out where i went wrong, has anyone had this error before ?

Its hard to be a noob ; )

here is my invoice controller

public function viewpdf(Invoice $invoice)
{

    $invocie = Invoice::find($invoice);

    view()->share('invoices', $invoice);
    $invoice = Pdf::loadView('admin.invoice.viewpdf')
        ->setPaper('a4','landscape')
        ->setWarnings(false)
        ->setOption(['dpi' => 150, 'defaultFont' => 'sans-serif']);
    return $invocie->stream();
}

	I have the imported the
	
	use Barryvdh\DomPDF\Facade\Pdf;

it also indicate a bad method call

Did you mean Illuminate\Database\Eloquent\Collection::transform() ?
0 likes
4 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

You have typo? invocie vs invoice

Dirk313's avatar

@sinnbeck LOL NOOOOOOO!!!! 8 hours for a typo : ) so i think its time to go back to school for me hehehe, Thank you for pointing out the error, i feel like a complete NUT now lol

Dirk313's avatar

@Sinnbeck Sometime just sitting back and reevaluate what has been done and reading the code will solve so much frustrations haha

Please or to participate in this conversation.