Excel utility package for Laravel Enso
This package can work independently of the Enso ecosystem.
For live examples and demos, you may visit laravel-enso.com
install using composer:
composer require laravel-enso/excel
- is a small wrapper that uses box/spout under the hood
- utilizes two contracts for which require specific methods to be available on the specific Excel file generator
ExcelExportservice requires an excel generator parameter that must implement at least the
ExportsExcelcontract and optionally the
- can provide the generated excel document inline (for downloads) or save the file to disk
In order to generate an Excel, you need to create a generator class that implements the
contract. Then you must instantiate an
ExcelExport class, passing your generator as a constructor parameter,
and finally call the
$excel = new MyExcelExporter(); (new ExcelExport($excel))->inline();
If you want to have the excel file saved to disk, have your generator also implement the
contract, and instead of calling the
inline() method, call the
save() method on your
$excel = new MyExcelExporter(); (new ExcelExport($excel))->save();
are welcome. Pull requests are great, but issues are good too.
This package is released under the MIT license.