nethercore/csv-exporter
最新稳定版本:1.0.1
Composer 安装命令:
composer require nethercore/csv-exporter
包简介
CSV Exporter for laravel
README 文档
README
Installation via composer:
composer require nethercore/csv-exporter
Usage:
Generated files will appear in App/Exports/{name}Export.php
Use double backslashes for nested name or model files.
php artisan make:export {name} {model}
e.g php artisan make:export Wharehouse\\Product Stock\\Item will create app/Exports/Wharehouse/ProductExport.php using Models/Stock/Item.php inside the export file.
Example Code:
namespace App\Exports;
use App\Models\Product;
use Nethercore\CsvExporter\Interfaces\BaseExporterInterface;
use Nethercore\CsvExporter\Traits\StreamResponseTrait;
use Symfony\Component\HttpFoundation\StreamedResponse;
final class ProductExport implements BaseExporterInterface
{
use StreamResponseTrait;
...
}
use App\Exports\ProductExport;
class ProductController extends Controller
{
public function export()
{
return (new ProductExport('some product title'))->export());
}
}
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-10