定制 laravel-enso/dataexport 二次开发

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

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

laravel-enso/dataexport

最新稳定版本:3.8.8

Composer 安装命令:

composer require laravel-enso/dataexport

包简介

Structure for holding Laravel-Enso exports

README 文档

README

License Stable Downloads PHP Issues Merge Requests

Description

Data Export adds tracked XLSX export generation to Enso.

The package stores export state and progress, attaches the generated file to the Enso files system, supports both asynchronous query-based exports and synchronous in-memory exporters, and notifies users when the export finishes or fails.

It is designed for backoffice flows where long-running exports should be observable, cancellable, and retained for a configurable period.

Installation

Install the package:

composer require laravel-enso/data-export

Run the package migrations:

php artisan migrate

Optional publishes:

php artisan vendor:publish --tag=data-export-config
php artisan vendor:publish --tag=data-export-mail

Default configuration:

return [
    'rowLimit' => env('EXPORT_ROW_LIMIT', 1000000),
    'retainFor' => (int) env('EXPORT_RETAIN_FOR', 60),
];

The package schedules enso:data-export:purge daily.

Features

  • Asynchronous XLSX exports based on a query builder.
  • Synchronous export support for classic Enso Excel exporters.
  • Export progress tracking and IO broadcasting support.
  • File attachment and cleanup integration through laravel-enso/files.
  • Shared mail layout and preview registration through laravel-enso/mails, including a download link for finalized files.
  • Hooks for setup, teardown, custom notifications, custom row actions, and custom sheet names.
  • Cancel endpoint and automatic retention purge.

Usage

Implement the asynchronous exporter contract:

use Illuminate\Database\Eloquent\Builder;
use LaravelEnso\DataExport\Contracts\ExportsExcel;

class OrdersExport implements ExportsExcel
{
    public function filename(): string
    {
        return 'orders.xlsx';
    }

    public function heading(): array
    {
        return ['Id', 'Number'];
    }

    public function query(): Builder
    {
        return Order::query();
    }

    public function attributes(): array
    {
        return ['id', 'number'];
    }

    public function mapping($row): array
    {
        return [$row->id, $row->number];
    }
}

Dispatch the export through the model:

use LaravelEnso\DataExport\Models\Export;

Export::excel(new OrdersExport());

API

HTTP routes

  • PATCH api/export/{export}/cancel

Route name:

  • export.cancel

Artisan commands

  • enso:data-export:purge

Extension points

  • BeforeHook
  • AfterHook
  • CustomCount
  • CustomMax
  • CustomMin
  • CustomRowAction
  • CustomSheetName
  • Notifies

Depends On

Required Enso packages:

Optional Enso companion package:

Required external package:

Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固