marshmallow/actions-change-sequence
最新稳定版本:v3.2.0
Composer 安装命令:
composer require marshmallow/actions-change-sequence
包简介
A Nova action to change the sequence of resources more easily
README 文档
README
Laravel Nova Change Sequence
Update the sequences on your resource in Laravel Nova. This package currently supports:
- Place at the top
- Place at the bottom
- Place in location
Installatie
composer require marshmallow/actions-change-sequence
Usage
public function actions(Request $request) { return array_merge([ // ], SequenceActions::make()); }
If you want to sequence a group op items in a resources you can use the group() method. For instance; if you have a table with invoice items and you want to change the order of the items on a invoice, you really need to change the sequence of only the items in a certant invoice, not the whole table. See the example below.
public function actions(Request $request) { return array_merge([ // ], SequenceActions::groupBy('invoice_id')->make()); }
By default we will use a sequence ascending and check for the column sequence. You can override this in the constructor:
SequenceActions::make('asc', 'sequence'); new SequenceFirst('desc', 'order_column');
Optionaly, you can add every action manualy. We don't recommend this. If you use the shorthand above, this will make sure you will directly profit of new actions added in the future.
public function actions(Request $request) { return [ new SequenceFirst, new SequenceLast, new SequencePlace, ]; }
统计信息
- 总下载量: 5.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-21