cube-agency/filament-excel 问题修复 & 功能扩展

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

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

cube-agency/filament-excel

Composer 安装命令:

composer require cube-agency/filament-excel

包简介

Excel exports and imports for Filament 4 and 5, powered by Laravel Excel

README 文档

README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Excel exports and imports for Filament 4 and 5, powered by Laravel Excel.

Where Filament's native export/import actions stop, this plugin continues:

  • Real XLSX styling — cell number formats, column widths, style arrays, bold + frozen headers, raw PhpSpreadsheet access
  • Multi-sheet workbooks — each sheet with its own query, columns and styling
  • Table-aware exports — zero-config export of the visible columns, respecting filters, search, sort and selection
  • Import wizard — file upload, column mapping with auto-guessing, per-row validation
  • Failures report — invalid rows are skipped and collected into a downloadable XLSX (original values + error messages), ready to fix and re-upload
  • Synchronous by default, queued on demand->queued() switches to chunked jobs with database notifications, signed expiring download links and automatic pruning
  • Raw query support — export from DB::table() joins and array rows, not just Eloquent

Requirements

  • PHP 8.3+
  • Laravel 11.28+ / 12 / 13
  • Filament 4 or 5

Installation

composer require cube-agency/filament-excel

That's it — no plugin registration needed. Optionally publish the config:

php artisan vendor:publish --tag="filament-excel-config"

For queued exports/imports, enable database notifications in your panel.

Quick start

Export

use CubeAgency\FilamentExcel\Actions\ExcelExportAction;
use CubeAgency\FilamentExcel\Actions\ExcelExportBulkAction;
use CubeAgency\FilamentExcel\Exports\Columns\Column;

$table
    ->headerActions([
        // Zero config: exports visible columns, respecting filters, search and sort
        ExcelExportAction::make(),

        // Or configured inline
        ExcelExportAction::make('styled')
            ->columns([
                Column::make('name')->width(40),
                Column::make('email')->heading('E-mail'),
                Column::make('balance')->format('#,##0.00'),
            ])
            ->filename('users'),
    ])
    ->toolbarActions([
        ExcelExportBulkAction::make(), // selected rows only
    ]);

Import

use CubeAgency\FilamentExcel\Actions\ExcelImportAction;
use CubeAgency\FilamentExcel\Imports\Columns\ImportColumn;

ExcelImportAction::make()
    ->model(User::class)
    ->columns([
        ImportColumn::make('name')->required(),
        ImportColumn::make('email')->required()->rules(['email'])->guess(['e-mail']),
    ])

Users upload a file, map its columns (pre-matched automatically), and invalid rows come back as a downloadable failures report.

Documentation

  • Exports — actions, columns, styling, multi-sheet workbooks, queueing, raw queries
  • Imports — mapping, validation, custom row handling, failures report
  • Configuration — disks, expiry, queues, downloads, pruning

Testing

composer test

Changelog

See CHANGELOG for recent changes.

Credits

License

MIT. See LICENSE.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-29