<?php

namespace App\Exports\Ingles;

use App\User;
use Maatwebsite\Excel\Excel;
use Illuminate\Contracts\Support\Responsable;
use Maatwebsite\Excel\Concerns\Exportable;
use Illuminate\Contracts\View\View;
use Maatwebsite\Excel\Concerns\FromView;
use Maatwebsite\Excel\Concerns\FromCollection;

class LiberacionExport implements FromView, Responsable
{
	use Exportable;

    /**
    * It's required to define the fileName within
    * the export class when making use of Responsable.
    */
    private $fileName = 'liberacion.xlsx';
    
    /**
    * Optional Writer Type
    */
    private $writerType = Excel::XLSX;
    
    /**
    * Optional headers
    */
    private $headers = [
        'Content-Type' => 'text/csv',
    ];

    public function collection()
    {
        return Invoice::all();
    }


	public function __construct($resultados)
    {
        $this->resultados = $resultados;
    }


    public function view(): View
    {
        return view('examen_ingles.liberacion.alumnos.export', [
            'resultados' => $this->resultados
        ]);
    }
}
