update code
This commit is contained in:
35
app/Exports/ComeInDocumentsExport.php
Normal file
35
app/Exports/ComeInDocumentsExport.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Shared\Date;
|
||||
|
||||
class ComeInDocumentsExport extends BaseDocumentsExport
|
||||
{
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'Ngày nhận',
|
||||
'Nơi ban hành',
|
||||
'Ký hiệu',
|
||||
'Loại',
|
||||
'Trích yếu',
|
||||
'Người nhận',
|
||||
];
|
||||
}
|
||||
|
||||
public function map($document): array
|
||||
{
|
||||
return [
|
||||
Date::dateTimeToExcel($document->effective_at),
|
||||
$document->publisher->name,
|
||||
$document->symbol,
|
||||
$document->type->name,
|
||||
$document->abstract,
|
||||
implode(', ', ($document->receivers->map(function($receiver){
|
||||
return $receiver->name;
|
||||
}))->toArray()),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user