重新排序背包 laravel 中的行按钮?

Reorder line buttons in Backpack laravel?

我创建了一个自定义按钮 status_history 并将其放在堆栈的末尾 $this->crud->addButtonFromView('line', 'History', 'status_history', 'end'); 现在我想将它放在 edit 按钮之前?我该怎么做?

使用 the fluent syntax 是最短的方法,您可以这样做:

CRUD::button('status_history')->after('update')->view('status_history');

或者,如果您更喜欢数组语法,您可以在 addButtonFromView 调用后调用其中之一:

  • $this->crud->moveButton($target, $where, $destination) - 见 here
  • $this->crud->orderButtons(string $stack, array $order) - 参见 here

看起来这些方法没有正确记录(或根本没有)- 很抱歉,将尽快修复。在那之前,docblocks 应该解释他们做得很好。