<?php

namespace App\Exports;

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

class CustomExport implements FromView
{
    public $view;
    public $data;
    public $title;

    public function __construct($view, $data = "", $title = "")
    {
        $this->view = $view;
        $this->data = $data;
        $this->title = $title;
    }

    public function view(): View
    {
        return view(
            $this->view,
            ["data"=>$this->data, "title"=>$this->title]
        );
    }
    
}
