ryangjchandler / filament-data-studio
为您的Filament资源提供零配置的CSV导出。
v1.0.0-beta2
2023-12-08 21:33 UTC
Requires
- php: ^8.1
- filament/filament: ^3.0
- illuminate/contracts: ^10.0
- ryangjchandler/filament-progress-column: ^0.4.1
- spatie/laravel-package-tools: ^1.15.0
- spatie/simple-excel: ^3.3
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-09-08 22:40:33 UTC
README
安装
您可以通过Composer安装此包
composer require ryangjchandler/filament-data-studio
安装完包后,使用filament-data-studio:install
命令发布并运行迁移。
php artisan filament-data-studio:install
使用方法
在您的Panel
上注册插件。
use RyanChandler\DataStudio\DataStudioPlugin; $panel ->plugin(DataStudioPlugin::make());
将ExportAction
添加到您的Resource
表之一。
use RyanChandler\DataStudio\Actions\ExportAction; public static function table(Table $table): Table { return $table ->columns([ // ... ]) ->filters([ // ... ]) ->headerActions([ ExportAction::make(), ]); }
在您的面板中打开资源并开始导出数据!
使用自定义Export
模型
如果您想更改Export
模型并添加自己的列,可以通过创建一个继承自基本Export
模型的模型来实现,然后配置插件使用新的模型。
use RyanChandler\DataStudio\Models\Export as BaseExport; class Export extends BaseExport { // }
在您的PanelProvider
中
use App\Models\Export; $panel ->plugin( DataStudioPlugin::make() ->exportModelClass(Export::class) );
测试
composer test
变更日志
请参阅CHANGELOG以获取有关最近更改的更多信息。
贡献
请参阅CONTRIBUTING以获取详细信息。
安全漏洞
请查阅我们的安全策略了解如何报告安全漏洞。
鸣谢
许可
MIT许可(MIT)。有关更多信息,请参阅许可文件。