LaravelPackages.net
Acme Inc.
Toggle sidebar
xerobase/excel-reporter

Creating excel reports never been easier!

97
8
v1.0.0
About xerobase/excel-reporter

xerobase/excel-reporter is a Laravel package for creating excel reports never been easier!. It currently has 8 GitHub stars and 97 downloads on Packagist (latest version v1.0.0). Install it with composer require xerobase/excel-reporter. Discover more Laravel packages by xerobase or browse all Laravel packages to compare alternatives.

Last updated

excel-reporter

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);

Star History Chart