<?php
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromArray;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithEvents;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Events\AfterSheet;
class uangMukaExport implements FromArray, WithHeadings, ShouldAutoSize, WithEvents
{
/**
* @return \Illuminate\Support\Collection
*/
/**
* @var array
*/
protected $export;
/**
* ExampleExport constructor.
*
* @param array $export
*/
public function __construct(array $export)
{
$this->export = $export;
}
/**
* @return array
*/
public function array(): array
{
return $this->export;
}
/**
* @return array
*/
public function headings(): array
{
return [
'No Service',
'Nama_pelanggan',
'Merk & type',
'Kerusakan',
'Status Pengerjaan',
'Nama Teknisi',
'Nama Kasir',
'Nama Sales',
'DP',
'Metode Pembayaran',
'Biaya',
];
}
/**
* @return array
*/
public function registerEvents(): array
{
return [
AfterSheet::class => function (AfterSheet $event) {
// Menetapkan style pada baris header
$event->sheet->getStyle('1')->applyFromArray([
'font' => [
'bold' => true,
'size' => 12,
]
]);
},
];
}
}
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]