pdf in laravel :(

Posted 3 months ago by meeadhassan

how i can generate a pdf file using dompdf package i get this error

ErrorException (E_ERROR) Undefined variable: order (View: C:\xampp\htdocs\Partenrs\resources\views\orders\show.blade.php) Previous exceptions

this is my code

public function downloadPDF($id)
    $pdf = App::make('dompdf.wrapper');
    $order = MiniMarketOrder::find($id);
    $pdf = \PDF::loadView('orders/show',$order);

   return $pdf->download('show.pdf');

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.