<?php

namespace App\Exports;

use DB;
use App\Order;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\Request;
use Maatwebsite\Excel\Concerns\FromView;

class OrderExport implements FromView
{
    public function view(Request $request): View
    {
        $order = Order::findOrFail($request->id);

        return view('exports.order', [
            'order' => $order
        ]);
    }
}
