You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
693 B

<?php
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromArray;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithCustomValueBinder;
use PhpOffice\PhpSpreadsheet\Cell\StringValueBinder;
// All imported names and descriptions stay literal; never execute Excel formulas.
class SupplyDemandExport extends StringValueBinder implements FromArray, WithHeadings, WithCustomValueBinder
{
private $rows; private $headers;
public function __construct(array $rows, array $headers) { $this->rows = $rows; $this->headers = $headers; }
public function array(): array { return $this->rows; }
public function headings(): array { return $this->headers; }
}