Files
Document-Management-System-…/app/Exports/PrivateDocumentsExport.php
2021-04-09 10:42:08 -04:00

39 lines
864 B
PHP

<?php
namespace App\Exports;
use PhpOffice\PhpSpreadsheet\Shared\Date;
class PrivateDocumentsExport extends BaseDocumentsExport
{
public function headings(): array
{
return [
'Дата выдачи',
'Ký hiệu',
'Тип документа',
'Краткое содержание',
'Получатель',
];
}
/**
* @param mixed $document
*
* @return array
*/
public function map($document): array
{
return [
Date::dateTimeToExcel($document->effective_at),
$document->symbol,
$document->type->name,
$document->abstract,
implode(', ', ($document->organizes->map(function($organize){
return $organize->name;
}))->toArray()),
];
}
}