digital-creative / batch-edit-toolbar
允许您一次性更新资源的单个列。
v0.0.4
2023-10-21 13:10 UTC
Requires
- php: >=8.1
- laravel/nova: ^4.0
README
允许您直接从索引页面一次性更新资源的单个列。
安装
您可以通过composer安装此包
composer require digital-creative/batch-edit-toolbar
基本用法
要使用新的功能,您只需将batchEditable
方法添加到您的字段定义中,此方法应返回一个包含以下定义的选项的数组。
class UserResource extends Resource { public function fields(NovaRequest $request): array { return [ Text::make('Title', 'title') ->rules('required') ->batchEditable(fn () => [ 'icon' => 'annotation', // accepts any heroicon name supported by Nova: https://v1.heroicons.com /** * These are all optional, and the current values are the default ones */ 'tooltip' => 'Update {attribute}', // Appears when hovering the icon. 'title' => 'Update {attribute}', // Appears in the modal title. 'cancelButtonText' => 'Cancel', // Appears in the modal cancel button. 'confirmButtonText' => 'Update', // Appears in the modal confirm button. 'confirmText' => null, // Appears above the field in the modal. 'modalSize' => '2xl', // Can be "sm", "md", "lg", "xl", "2xl", "3xl", "4xl", "5xl", "6xl", "7xl". 'modalStyle' => 'window', // Can be either 'fullscreen' or 'window'. ]), /** * You can also use a custom SVG icon directly */ Text::make('Description', 'description') ->rules('required') ->batchEditable(fn () => [ 'icon' => <<<SVG <svg>...</svg> SVG, ]), ]; } }
⭐️ 显示您的支持
如果此项目对您有所帮助,请给予⭐️支持!
您可能还喜欢的其他包
- Nova Dashboard - Laravel Nova缺失的仪表板!
- Nova Welcome Card - Nova附带的
帮助卡
的可配置版本。 - Icon Action Toolbar - 用基于图标的操作行替换默认的枯燥操作菜单。
- Expandable Table Row - 提供了一种简单的方法将额外数据附加到资源表中的每一行。
- Collapsible Resource Manager - 提供了一种简单的方法对侧边栏中的资源进行排序和分组。
- Resource Navigation Tab - 将您的资源字段组织到选项卡中。
- Resource Navigation Link - 创建指向内部或外部资源的链接。
- Nova Mega Filter - 在卡片中显示所有过滤器而不是微型下拉菜单!
- Nova Pill Filter - 一个渲染为可点击药丸的Laravel Nova过滤器。
- Nova Slider Filter - 一个Laravel Nova过滤器,用于在最小/最大值之间选择范围。
- Nova Range Input Filter - 一个Laravel Nova范围输入过滤器。
- Nova FilePond - 使用Filepond上传文件、图片和视频的Nova字段。
- Custom Relationship Field - 在没有在资源之间设置实际关系的情况下模拟HasMany关系。
- Column Toggler - 允许您在索引视图中隐藏/显示列的Laravel Nova包。
- Batch Edit Toolbar - 允许您直接从索引页面一次性更新资源的单个列。
许可证
MIT许可证(MIT)。请参阅许可证文件以获取更多信息。