wali/filament-word-export
Composer 安装命令:
composer require wali/filament-word-export
包简介
A powerful Filament plugin for exporting table data to Word documents with customizable headers, footers, and styling
README 文档
README
A Filament plugin for exporting table data to Microsoft Word (DOCX) format.
Requirements
- PHP 8.3+
- Laravel 11.x or 12.x
- Filament 3.x or 4.x
Installation
You can install the package via composer:
composer require wali/filament-word-export
Usage
Basic Usage
Add the export action to your Filament table:
use Wali\FilamentWordExport\Actions\ExportToWordAction; public function table(Table $table): Table { return $table ->columns([ // Your table columns ]) ->bulkActions([ ExportToWordAction::make(), ]); }
Customizing Headers and Footers
You can customize headers and footers per action:
use Wali\FilamentWordExport\Actions\ExportToWordAction; public function table(Table $table): Table { return $table ->bulkActions([ // Custom header and footer text ExportToWordAction::make() ->headerText('My Company Report') ->footerText('Confidential Document') ->withPageNumbers(), // Disable headers/footers entirely ExportToWordAction::make('export-clean') ->label('Export (Clean)') ->withoutHeader() ->withoutFooter(), // Custom filename ExportToWordAction::make('export-custom') ->filename('custom-report-' . now()->format('Y-m-d') . '.docx'), ]); }
Advanced Customization
For more advanced customization, you can use template overrides:
ExportToWordAction::make() ->templateOverrides([ 'header.style.size' => 12, 'header.style.color' => '0066CC', 'footer.style.italic' => true, 'footer.page_number_alignment' => 'left', ])
Configuration
Publish the configuration file:
php artisan vendor:publish --tag="filament-word-export-config"
Configuration Options
The configuration file allows you to set default values for headers and footers:
return [ 'header' => [ 'enabled' => true, 'text' => 'Generated by Filament Word Export Plugin', 'style' => [ 'italic' => true, 'size' => 10, 'color' => '000000', 'alignment' => 'center', ], 'logo' => [ 'enabled' => false, 'path' => null, // e.g., 'logos/company-logo.png' 'width' => 100, 'height' => 50, 'alignment' => 'left', ], ], 'footer' => [ 'enabled' => true, 'text' => 'Generated via Filament Word Export Plugin', 'style' => [ 'size' => 9, 'color' => '999999', 'alignment' => 'center', ], 'show_page_numbers' => true, 'page_number_format' => 'Page {PAGE} of {NUMPAGES}', 'page_number_alignment' => 'right', ], ];
Development
This project uses Laravel Pint for code formatting and Rector for automated refactoring.
Code Formatting with Pint
# Check code style composer lint:test # Fix code style issues composer lint # Fix only dirty files (git) composer lint:dirty
Code Refactoring with Rector
# Preview changes (dry run) composer refactor:dry # Apply refactoring changes composer refactor
Combined Commands
# Check formatting and preview refactoring composer format # Apply both formatting and refactoring composer fix
Manual Tool Usage
You can also run the tools directly:
# Pint ./vendor/bin/pint ./vendor/bin/pint --test ./vendor/bin/pint --dirty # Rector ./vendor/bin/rector process ./vendor/bin/rector process --dry-run
Configuration Files
pint.json- Laravel Pint configurationrector.php- Rector configurationconfig/filament-word-export.php- Plugin configuration
License
The MIT License (MIT). Please see License File for more information.
wali/filament-word-export 适用场景与选型建议
wali/filament-word-export 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「word」 「docx」 「export」 「laravel」 「PhpWord」 「filament」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 wali/filament-word-export 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wali/filament-word-export 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 wali/filament-word-export 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Bulk export of sylius resources
Yii2 export extension
Unofficial port of the Carbone API SDK to Saloon v3
A simple API extension for SplFileObject
Generate random words and sentences with ease in PHP.
Export any WordPress post type to CVS.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-06