<?php

namespace App\Exports;

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

class RekapKehadiranExport implements FromView
{
    protected $items;
    protected $jadwals;
    protected $periode;
    protected $tanggal;
    protected $bulan;
    protected $tahun;
    protected $user;

    public function __construct(
    $items,
    $jadwals,
    $user,
    $periode,
    $tanggal,
    $bulan,
    $tahun
) {
    $this->items = $items;
    $this->jadwals = $jadwals;
    $this->user = $user;
    $this->periode = $periode;
    $this->tanggal = $tanggal;
    $this->bulan = $bulan;
    $this->tahun = $tahun;
}

   public function view(): View
{
    return view('guru.rekap-kehadiran.excel', [
        'items' => $this->items,
        'jadwals' => $this->jadwals,
        'user' => $this->user,
        'periode' => $this->periode,
        'tanggal' => $this->tanggal,
        'bulan' => $this->bulan,
        'tahun' => $this->tahun,
    ]);
}
}