You have typo? invocie vs invoice
Dec 12, 2022
4
Level 4
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() ?
Level 102
Please or to participate in this conversation.