laravel-enso/dataexport
最新稳定版本:3.8.8
Composer 安装命令:
composer require laravel-enso/dataexport
包简介
Structure for holding Laravel-Enso exports
README 文档
README
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
BeforeHookAfterHookCustomCountCustomMaxCustomMinCustomRowActionCustomSheetNameNotifies
Depends On
Required Enso packages:
laravel-enso/core↗laravel-enso/enums↗laravel-enso/files↗laravel-enso/helpers↗laravel-enso/io↗laravel-enso/mails↗laravel-enso/track-who↗
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
其他信息
- 授权协议: MIT
- 更新时间: 2018-09-11