SampelSTExport.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Exports;
  3. use Maatwebsite\Excel\Concerns\ShouldAutoSize;
  4. use Maatwebsite\Excel\Concerns\WithCustomStartCell;
  5. use Maatwebsite\Excel\Concerns\WithHeadings;
  6. use Maatwebsite\Excel\Concerns\WithMapping;
  7. use Maatwebsite\Excel\Concerns\WithTitle;
  8. use Maatwebsite\Excel\Concerns\FromArray;
  9. use Maatwebsite\Excel\Concerns\Exportable;
  10. use Auth;
  11. use Carbon\Carbon;
  12. class SampelSTExport implements FromArray, WithHeadings, WithCustomStartCell, ShouldAutoSize
  13. {
  14. /**
  15. * @return \Illuminate\Support\Collection
  16. */
  17. public function __construct(array $invoices)
  18. {
  19. $this->invoices = $invoices;
  20. }
  21. public function array(): array
  22. {
  23. return $this->invoices;
  24. }
  25. public function headings(): array
  26. {
  27. return ['No. Tagihan', 'No. Klien', 'Nama Klien', 'BHP (Rp)', 'Tanggal (BI Create Date)', 'Status Pembayaran', 'Service', 'Tanggal Jatuh Tempo', 'Upaya / Methode', 'Tanggal Upaya', 'Keterangan'];
  28. }
  29. public function startCell(): string
  30. {
  31. return 'A1';
  32. }
  33. }