xerobase / excel-reporter
Creating excel reports never been easier!
Installs: 95
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/xerobase/excel-reporter
Requires
- phpoffice/phpspreadsheet: ^1.5
This package is auto-updated.
Last update: 2026-01-19 21:30:30 UTC
README
Create excel reports, from any data structure (collection, array, objects) with a line of code!
Installation
composer require xerobase/excel-reporter
Usage
Create an instance of Export class
$exporter = new \Xerobase\ExcelReporter\Export();
You can simply export your data by calling export method :
// Your source can be an Eloquent Model $books = \App\Models\Book::all(); // Or an associative array $books = [ 'Title' => 'Foo', 'Author' => 'Bar' ]; // Or an stdClass object $books = new stdClass(); $books->title = 'Foo'; $books->author = 'Bar'; $exporter->export($books);
Maybe want to filter some of unnecessary fields :
$exporter->filterColumns(['id', 'created_at', 'updated_at'])->export($books);
Set direction to RTL :
$exporter->setRightToLeft()->export($books);
Or change format to CSV :
$exporter->setFormat('csv')->export($books);