ResearchProjectDetailMultiExport.php 657 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Exports;
  3. use Maatwebsite\Excel\Concerns\WithMultipleSheets;
  4. class ResearchProjectDetailMultiExport implements WithMultipleSheets
  5. {
  6. protected $year;
  7. protected $projects;
  8. protected $taxInfo;
  9. public function __construct($year, array $projects, array $taxInfo) {
  10. $this->year = $year;
  11. $this->projects = $projects;
  12. $this->taxInfo = $taxInfo;
  13. }
  14. public function sheets(): array {
  15. $sheets = [];
  16. foreach ($this->projects as $project) {
  17. $sheets[] = new ResearchProjectDetailSheetExport($this->year, $project, $this->taxInfo);
  18. }
  19. return $sheets;
  20. }
  21. }