Files
Document-Management-System-…/app/Exports/ComeInDocumentsExport.php

36 lines
874 B
PHP
Raw Normal View History

2021-04-07 06:32:42 -04:00
<?php
namespace App\Exports;
use PhpOffice\PhpSpreadsheet\Shared\Date;
class ComeInDocumentsExport extends BaseDocumentsExport
{
public function headings(): array
{
return [
2021-04-09 10:42:08 -04:00
'Дата получения',
'Место выдачи',
2021-04-07 06:32:42 -04:00
'Ký hiệu',
2021-04-09 10:42:08 -04:00
'Тип документа',
'Краткое содержание',
'Получатель',
2021-04-07 06:32:42 -04:00
];
}
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()),
];
}
}