niiyz/laravel-csv
最新稳定版本:1.0.1
Composer 安装命令:
composer require niiyz/laravel-csv
包简介
Laravel5 Simple CSV Downloader
关键字:
README 文档
README
Laravel-CsvDownloader is Very Simple Csv Downloader
#Installation
Require this package in your composer.json and update composer.
"niiyz/laravel-csv": "~1.0.1"
After updating composer, add the ServiceProvider to the providers array in config/app.php
'Niiyz\Csv\CsvServiceProvider',
You can use the facade for shorter code. Add this to your aliases:
'Csv' => 'Niiyz\Csv\Facades\Csv',
The class is bound to the ioC as csv
use Csv;
Sample.1
Csv::create([[1, 2, 3], [10, 20, 30]], []); Csv::convertEncoding('UTF-8', 'SJIS-win');// ex. Japanese return Csv::download('sample.csv');
Sample.2
$users = \User::where('type', '=', '1')->get(['name', 'birth_day'])->toArray();// from DB $header = ['customer', 'birthday']; Csv::create($users, $header); Csv::convertEncoding('UTF-8', 'SJIS-win');// ex. Japanese return Csv::download('customers.csv');
统计信息
- 总下载量: 10.09k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-01