niiyz/laravel-csv 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-01