namespace App\ExcelExports\Pro; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithHeadings; class ProctoringUploadSheetExport implements FromCollection, WithHeadings { protected $headers; protected $rows; public function __construct(array $headers, array $rows) { $this->headers = $headers; $this->rows = $rows; } public function collection() { return collect($this->rows); } public function headings(): array { return $this->headers; } }