tbcd / excel-utils
Easy way to create Excel worksheets, spreadsheets and files
Installs: 50
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/tbcd/excel-utils
Requires
- php: >=8.1.0
- ext-ctype: *
- ext-iconv: *
- phpoffice/phpspreadsheet: ^1.19
- symfony/filesystem: ^6.0
Requires (Dev)
- phpunit/phpunit: ^9.5|^10.0
This package is auto-updated.
Last update: 2025-10-05 21:36:36 UTC
README
This library to easily create excel worksheets, spreadsheets and files.
Usage
- Inject the service from container if you have one or create it
private ExcelFileFactory $excelFileFactor;
public function __construct(ExcelFileFactory $excelFileFactory)
{
$this->excelFileFactory = $excelFileFactory;
}
$excelFileFactory = new ExcelFileFactory($spreadsheetFactory);
- Create the file with your data
$data = [
[
'column1' => 'row1',
'column2' => 'row1',
'column3' => 'row1'
],
[
'column1' => 'row2',
'column2' => 'row2',
'column3' => 'row2'
]
];
$filePath = $fileFactory->createFileWithData(new WorksheetData($data, 'my-sheet-name'), 'my_file.xlsx');
- Get then result below