HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/Eurotools/euro-tools.nl/app/KommaApp/Shop/Orders/OrderController.php
<?php


namespace App\KommaApp\Shop\Orders;


use App\KommaApp\Shop\Notifications\AdminOrderConfirmation;
use Barryvdh\DomPDF\PDF;
use Illuminate\Mail\Markdown;
use Illuminate\Notifications\Messages\MailMessage;

class OrderController
{
    public function createInvoice(Order $order)
    {
        $order->load('customer');

//        $notification = (new AdminOrderConfirmation($order))->toMail('pascal@komma.pro');
//        $view = view($notification->view)->with(['order' => $order, 'customer' => $order->customer]);
//        return $view;

//        PDF::setOptions(['isHtml5ParserEnabled' => true]);

//        $pdf = \App::make('dompdf.wrapper');
//        $view = view('shop.PDF.invoice', ['order' => $order])->render();

//        dd($pdf);

//        $pdf->loadHTML($view);
//        $pdf->render();

        $pdf = \PDF::loadView('shop.PDF.invoice', ['order' => $order]);

//        $storagePath = storage_path('app/pdfs/factuur-'.$order->order_number. '.pdf');
//        $pdf->save($storagePath);
//        return 'succes';

        return $pdf->stream('Factuur-'. $order->order_number . '.pdf');
    }
}