<?php

namespace App\Services;

use Illuminate\Contracts\View\View;
use Maatwebsite\Excel\Concerns\FromView;

class ViewExport implements FromView
{
    public function __construct($data,$view)
    {
        $this->data = $data;
        $this->view = $view;

    }

    public function view(): View
    {
        //dd($this->data);
        return view($this->view, $this->data);
    }

}
