Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gentritabazi/php-spreadsheet-excel
Build Excel In PHP Easy And Fast.
https://github.com/gentritabazi/php-spreadsheet-excel
laravel-csv laravel-excel php-csv php-excel php-spreadsheet php-spreadsheet-excel
Last synced: 29 days ago
JSON representation
Build Excel In PHP Easy And Fast.
- Host: GitHub
- URL: https://github.com/gentritabazi/php-spreadsheet-excel
- Owner: gentritabazi
- Created: 2020-12-09T12:27:20.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-29T17:14:30.000Z (about 4 years ago)
- Last Synced: 2024-11-29T03:45:54.978Z (about 1 month ago)
- Topics: laravel-csv, laravel-excel, php-csv, php-excel, php-spreadsheet, php-spreadsheet-excel
- Language: PHP
- Homepage:
- Size: 200 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Introduction
**PhpSpreadsheetExcel** is a package thats offers you to build Excel fast and easy in PHP.
This package depends on [PHPOffice/PhpSpreadsheet](https://github.com/PHPOffice/PhpSpreadsheet).
### Installation
* composer require **gentritabazi01/phpspreadsheetexcel**.### Usage
[Example 1](src/Examples/example-01.php):
```php
createSheet('Sheet 1', $columns, $rows, $config);
$spreadsheetExcel->save('file.xlsx');
```Output:
![...](screenshots/example-01.png)
[Example 2](src/Examples/example-02.php):
```php
'Hello World',
'auto_numbering' => true,
'columns_autosize' => true,
'columns_auto_filter' => true,
'borders' => true
];$spreadsheetExcel = new PhpSpreadsheetExcelService();
$spreadsheetExcel->createSheet('Sheet 1', $columns, $rows, $config);
$spreadsheetExcel->save('file.xlsx');
```Output:
![...](screenshots/example-02.png)
[Example 3](src/Examples/example-03.php):
```php
toArray();
$config = ['columns_autosize' => true];$spreadsheetExcel = new PhpSpreadsheetExcelService();
$spreadsheetExcel->createSheet('Sheet 1', $columns, $rows, $config);
$spreadsheetExcel->download('file.xlsx');
}
}
```Output:
![...](screenshots/example-03.png)
[Example 4](src/Examples/example-04.php):
```php
true];$parsedRows = $rows->map(function($row) {
$parsedRow['id'] = ['value' => $row['id']];
$parsedRow['name'] = ['value' => $row['name']];
$parsedRow['email'] = ['value' => $row['email']];// Style row - https://phpspreadsheet.readthedocs.io/en/latest/topics/recipes/#styles
if($row['name'] == 'Gentrit') {
$parsedRow['name']['style'] = [
'font' => ['color' => ['rgb' => 'FF0000']]
];
}
return $parsedRow;
});$spreadsheetExcel = new PhpSpreadsheetExcelService();
$spreadsheetExcel->createSheet('Sheet 1', $columns, $parsedRows, $config);
$spreadsheetExcel->download('file.xlsx');
}
}
```Output:
![...](screenshots/example-04.png)
### Available Functions
* stream.
* streamAsCsv.
* save.
* createSheet.
* download($fileName | 'file.xlsx').
* downloadAsCsv($fileName | 'file.csv').