All pages

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:

LocationMethodTypical use
Card menurecordActions()Edit, delete, replicate, move to top
Column headercolumnHeaderActions()Create a record in that column

Record actions

Register built-in or custom actions with recordActions():

php
<?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

ActionPage
EditEdit
DeleteDelete
ReplicateReplicate
Move to topMove to top
CustomCustom 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.