40 lines
1.0 KiB
PHP
40 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Modules\ProjectManagement\Exports;
|
|
|
|
use Maatwebsite\Excel\Concerns\FromArray;
|
|
use Maatwebsite\Excel\Concerns\WithHeadings;
|
|
use Maatwebsite\Excel\Concerns\WithStyles;
|
|
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
|
|
|
class TaskTemplateExport implements FromArray, WithHeadings, WithStyles
|
|
{
|
|
public function headings(): array
|
|
{
|
|
return [
|
|
'Name',
|
|
'Description',
|
|
'Start Date (YYYY-MM-DD)',
|
|
'End Date (YYYY-MM-DD)',
|
|
'Estimated Hours',
|
|
'Labor Cost',
|
|
'Sort Order',
|
|
];
|
|
}
|
|
|
|
public function array(): array
|
|
{
|
|
return [
|
|
['Foundation Work', 'Excavation and foundation laying', '2026-04-01', '2026-04-15', 40, 15000, 1],
|
|
['Concrete Pouring', 'Main structure concrete work', '2026-04-16', '2026-04-30', 80, 30000, 2],
|
|
];
|
|
}
|
|
|
|
public function styles(Worksheet $sheet): array
|
|
{
|
|
return [
|
|
1 => ['font' => ['bold' => true, 'size' => 11]],
|
|
];
|
|
}
|
|
}
|