<?php

namespace App\Exports;

use App\Models\UserAttendance;
use Illuminate\Contracts\View\View;
use Maatwebsite\Excel\Concerns\FromView;
use DB;
class UserAttendanceExport implements FromView
{
    protected $teammember_id;
    protected $customer_id;
    protected $year;

    function __construct($teammember_id,$month,$year) {
        $this->teammember_id = $teammember_id;
        $this->month = $month;
        $this->year = $year;
    }

    public function view(): View
    {
        return view('user_attendances.export', [
            'query' => UserAttendance::fetchAllUserAttendanceexport($this->teammember_id,$this->month,$this->year)
        ]);
    }
}
