定制 stianscholtz/query-exporter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

stianscholtz/query-exporter

最新稳定版本:0.0.3

Composer 安装命令:

composer require stianscholtz/query-exporter

包简介

A Laravel package to export queries to csv.

README 文档

README

Laravel Query Exporter is a handy utility package for Laravel applications that allows you to easily export query results to CSV files. It provides a simple and flexible interface to streamline the process of exporting database query results.

Features

  • Export query results to CSV files effortlessly.
  • Customize file name and headers for exported CSV files.
  • Seamless integration with Laravel's query builder via the DB Facade or Eloquent Models.

Installation

You can install the Laravel Query Exporter via Composer. Run the following command in your terminal:

composer require stianscholtz/query-exporter

Usage

Using the Laravel Query Exporter is straightforward:

use Stianscholtz\QueryExporter\QueryExporter;
use DB;

$query = DB::table('your_table')
            ->select('column1', 'column2')
            ->where('condition', 'value');

QueryExporter::forQuery($query)
    ->filename('my-file')
    ->headers(['Column 1', 'Column 2'])//Optional, selected columns in query will be used as default headers.
    ->export();

Contributing

Contributions are welcome! Please feel free to submit a pull request.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 54
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-08