All pages

actions

Action groups

Collapse secondary record or column header actions behind a dropdown menu.

When a card or column header carries more than two or three actions, collapse the secondary ones behind a menu so the UI stays readable.

Record action groups

php
use Asmit\AdvancedKanban\Actions\ActionGroup;
use Asmit\AdvancedKanban\RecordAction\Action;
use Asmit\AdvancedKanban\RecordAction\DeleteAction;

public function kanban(Kanban $kanban): Kanban
{
    return $kanban
        ->model(Task::class)
        ->statusField('status')
        ->recordActions([
            Action::make('edit')
                ->label('Edit')
                ->icon('heroicon-o-pencil')
                ->action(fn ($record) => $this->editTask($record)),
            ActionGroup::make([
                Action::make('view')
                    ->label('View Details')
                    ->icon('heroicon-o-eye')
                    ->action(fn ($record) => $this->viewTask($record)),
                Action::make('duplicate')
                    ->label('Duplicate')
                    ->icon('heroicon-o-document-duplicate')
                    ->action(fn ($record) => $this->duplicateTask($record)),
                DeleteAction::make('delete')
                    ->label('Delete')
                    ->icon('heroicon-o-trash')
                    ->color('danger')
                    ->action(fn ($record) => $this->deleteTask($record)),
            ])
                ->label('More Actions')
                ->icon('heroicon-o-ellipsis-vertical')
                ->dropdownPlacement('bottom-end'),
        ])
        ->columns([
            // Your columns here
        ]);
}

Column header action groups

php
use Asmit\AdvancedKanban\Actions\ActionGroup;
use Filament\Actions\Action;

public function kanban(Kanban $kanban): Kanban
{
    return $kanban
        ->model(Task::class)
        ->statusField('status')
        ->columns([
            // Your columns here
        ])
        ->columnHeaderActions([
            ActionGroup::make([
                Action::make('add_task')
                    ->label('Add Task')
                    ->icon('heroicon-o-plus')
                    ->action(fn ($arguments) => $this->addTask($arguments['status'])),
                Action::make('bulk_edit')
                    ->label('Bulk Edit')
                    ->icon('heroicon-o-pencil')
                    ->action(fn ($arguments) => $this->bulkEdit($arguments['status'])),
                Action::make('export_column')
                    ->label('Export Column')
                    ->icon('heroicon-o-arrow-down-tray')
                    ->action(fn ($arguments) => $this->exportColumn($arguments['status'])),
            ])
                ->label('More Actions')
                ->icon('heroicon-o-ellipsis-vertical')
                ->color('gray'),
        ]);
}

See also