waxwink/report
Composer 安装命令:
composer require waxwink/report
包简介
Producing excel tables out of laravel collections
README 文档
README
this package wraps around the php office spreadsheet to produce excel tables out of laravel collections.
Getting Started
Install the package with composer :
$ composer require waxwink/report
Instruction
Here is an examples to use the package :
use Illuminate\Support\Collection; use Waxwink\Report\Excel; require __DIR__."/vendor/autoload.php"; $keys = [ 'id'=> 'Product ID', 'name'=> 'Name', 'price'=> 'Price', ]; $collection = new Collection([ [ 'id'=> '1574', 'name'=> 'Phone', 'price'=> '100',], [ 'id'=> '6541', 'name'=> 'Printer', 'price'=> '150', ], [ 'id'=> '9652', 'name'=> 'Laptop', 'price'=> '350', ], [ 'id'=> '6971', 'name'=> 'Mouse', 'price'=> '30', ] ]); $xl = new Excel($collection, $keys); //this would save the file in the root folder : table.xlsx $xl->export('table');
you can also send the file to the client to download. :
// (works only if you're using laravel) return response()->download($xl->update());
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-03-12