awcodes/filament-table-repeater
Composer 安装命令:
composer require awcodes/filament-table-repeater
包简介
A modified version of the Filament Forms Repeater to display it as a table.
README 文档
README
Warning
This package is deprecated. As of Filament v4 the native Repeater covers the use case of this package and it is not needed anymore.
Table Repeater Plugin
Filament v4
Note
In Filament v4, Table Repeaters are built into Core. For more information, see the Filament documentation.
Upgrade Guide for 2.x to 3.x
- Rename you use statements from
Awcodes\FilamentTableRepeatertoAwcodes\TableRepeater. - Run
npm run buildto update your theme file. - See Headers for changes to the
headers()method.
Installation
You can install the package via composer:
composer require awcodes/filament-table-repeater
In an effort to align with Filament's theming methodology you will need to use a custom theme to use this plugin.
Important
If you have not set up a custom theme and are using a Panel follow the instructions in the Filament Docs first. The following applies to both the Panels Package and the standalone Forms package.
- Import the plugin's stylesheet in your theme's css file.
@import '<path-to-vendor>/awcodes/filament-table-repeater/resources/css/plugin.css';
- Add the plugin's views to your
tailwind.config.jsfile.
content: [ '<path-to-vendor>/awcodes/filament-table-repeater/resources/**/*.blade.php', ]
Usage
This field has most of the same functionality of the Filament Forms Repeater field. The main exception is that this field can not be collapsed.
use Awcodes\TableRepeater\Components\TableRepeater; use Awcodes\TableRepeater\Header; TableRepeater::make('users') ->headers([ Header::make('name')->width('150px'), ]) ->schema([ ... ]) ->columnSpan('full')
Headers
To add headers use the headers() method. and pass in an array of Header components.
use Awcodes\TableRepeater\Header; TableRepeater::make('users') ->headers([ Header::make('name'), Header::make('email'), ])
Header Alignment
To align the headers of the table use the align() method, passing in one of the Filament Alignment enums.
use Filament\Support\Enums\Alignment; Header::make('name') ->align(Alignment::Center)
Header Width
To set the width of the headers of the table use the width() method.
Header::make('name') ->width('150px')
Marking Columns as Required
To mark a column as required use the markAsRequired() method.
Header::make('name') ->markAsRequired()
Hiding the header
Even if you do not want to show a header, you should still add them to be compliant with accessibility standards. You can hide the header though with the renderHeader() method.
TableRepeater::make('users') ->headers(...) ->renderHeader(false)
Labels
By default, form component labels will be set to hidden. To show them use the showLabels() method.
TableRepeater::make('users') ->showLabels()
Empty State Label
To customize the text shown when the table is empty, use the emptyLabel() method.
TableRepeater::make('users') ->emptyLabel('There are no users registered.')
Alternatively, you can hide the empty label with emptyLabel(false).
Break Point
Below a specific break point the table will render as a set of panels to
make working with data easier on mobile devices. The default is 'md', but
can be overridden with the stackAt() method.
use Filament\Support\Enums\MaxWidth; TableRepeater::make('users') ->stackAt(MaxWidth::Medium)
Appearance
If you prefer for the fields to be more inline with the table. You can change the appearance of the table with the streamlined() method.
TableRepeater::make('users') ->streamlined()
Extra Actions
TableRepeater supports the same extraItemActions() as the native Filament repeater. You may also add extra actions below the table with the extraActions() method. These will appear next to the 'Add' button or in place of the 'Add' button if it is hidden.
TableRepeater::make('users') ->extraActions([ Action::make('exportData') ->icon('heroicon-m-inbox-arrow-down') ->action(function (TableRepeater $component): void { Notification::make('export_data') ->success() ->title('Data exported.') ->send(); }), ])
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
awcodes/filament-table-repeater 适用场景与选型建议
awcodes/filament-table-repeater 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 889.09k 次下载、GitHub Stars 达 265, 最近一次更新时间为 2022 年 10 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「plugin」 「laravel」 「filament」 「awcodes」 「table repeater」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 awcodes/filament-table-repeater 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 awcodes/filament-table-repeater 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 awcodes/filament-table-repeater 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
Plugin for YOURLS. Default tools to use in some laemmi plugins
Alfabank REST API integration
Database-driven onboarding for Filament: progress checklists and guided spotlight tours, translatable to any locale.
Allows polling user for event dates and times.
Support swipe touch gestures to navigate in paginated lists and on Tidypics image pages.
统计信息
- 总下载量: 889.09k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 265
- 点击次数: 16
- 依赖项目数: 7
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-28