actions
Overview
Record actions on cards, column header actions, and how to register them on a board.
Actions are the buttons and menus on a kanban board. There are two places they can live:
| Location | Method | Typical use |
|---|---|---|
| Card menu | recordActions() | Edit, delete, replicate, move to top |
| Column header | columnHeaderActions() | Create a record in that column |
Record actions
Register built-in or custom actions with recordActions():
<?php
use Asmit\AdvancedKanban\Kanban;
use Asmit\AdvancedKanban\RecordAction\Action;
use Asmit\AdvancedKanban\RecordAction\DeleteAction;
use Asmit\AdvancedKanban\RecordAction\EditAction;
use Asmit\AdvancedKanban\RecordAction\MoveToTopAction;
use Asmit\AdvancedKanban\RecordAction\ReplicateAction;
public function kanban(Kanban $kanban): Kanban
{
return $kanban
->model(Task::class)
->statusField('status')
->recordActions([
EditAction::make('edit')
->schema([
// Component schema here
]),
ReplicateAction::make('replicate'),
MoveToTopAction::make('moveToTop'),
DeleteAction::make('delete')
->requiresConfirmation()
->color('danger'),
Action::make('view')
->label('View')
->icon('heroicon-o-eye')
->action(fn ($record) => $this->viewTask($record)),
])
->columns([
// Your columns here
]);
}
Built-in record actions
| Action | Page |
|---|---|
| Edit | Edit |
| Delete | Delete |
| Replicate | Replicate |
| Move to top | Move to top |
| Custom | Custom actions |
When you have more than a few actions, collapse secondary ones behind a menu — see Action groups.
Column header actions
Column header actions run per column. The common case is a create button that pre-fills the status of the column it sits in. See Column header actions.
Related
- Action groups — collapse secondary actions behind a menu
- Record infolist — actions inside the card body
- Card reordering — required for move to top and position-aware create