33 lines
No EOL
646 B
PHP
33 lines
No EOL
646 B
PHP
<?php
|
|
namespace App\Exports;
|
|
|
|
use Maatwebsite\Excel\Excel;
|
|
use Maatwebsite\Excel\Concerns\FromCollection;
|
|
use Maatwebsite\Excel\Concerns\Exportable;
|
|
use Maatwebsite\Excel\Concerns\WithHeadings;
|
|
|
|
class ReportCollectionExport implements FromCollection, WithHeadings
|
|
{
|
|
protected $collection;
|
|
protected $headings;
|
|
|
|
use Exportable;
|
|
|
|
|
|
public function __construct($data,$header)
|
|
{
|
|
$this->collection = $data;
|
|
$this->headings = $header;
|
|
}
|
|
|
|
public function collection()
|
|
{
|
|
return collect($this->collection);
|
|
}
|
|
|
|
public function headings(): array
|
|
{
|
|
return [$this->headings];
|
|
}
|
|
|
|
} |