reference
API reference
Every method on the Kanban and KanbanColumn classes, plus the page hooks you can override.
Kanban
| Method | Description | Parameters |
|---|---|---|
model() | Set the Eloquent model for the kanban board | string|Model $model |
statusField() | Set the status field that decides column placement | string $field |
orderField() | Enable card reordering against a sortable column | ?string $field |
titleField() | Set the title field shown on cards | string $field |
descriptionField() | Set the description field shown on cards | string $field |
columns() | Set the kanban columns | array|Closure $columns |
searchableFields() | Set the fields that can be searched | bool|Closure $fields |
enableLoadingIndicator() | Enable or disable the loading indicator | Closure|bool $condition = true |
enableFilterIndicator() | Enable or disable the filter indicator | Closure|bool $condition = true |
filterFormSchema() | Set the filter form schema | array|Closure $schema |
recordActions() | Set the actions available on a record | array|Closure $actions |
columnHeaderActions() | Set the actions available in column headers | array|Closure $actions |
recordsPerColumn() | Set how many records load per column | int $count |
modifyQueryUsing() | Modify the base query for fetching records | Closure $callback |
modifyRecordQueryUsing() | Modify the query for a column's records | Closure $callback |
applyFiltersUsing() | Set custom filter logic | Closure $callback |
applySearchUsing() | Set custom search logic | Closure $callback |
emptyStateMessage() | Set the empty state copy | string $title, string $description |
KanbanColumn
| Method | Description | Parameters |
|---|---|---|
make() | Create a column for a status value | string $status |
label() | Set the column label | string|Closure $label |
description() | Set the column description | string $description |
icon() | Set the column icon | string|Closure|ScalableIcon $icon |
iconColor() | Set the icon colour | string|Closure $color |
hidden() | Hide or show the column | bool|Closure $hidden = true |
allowedTransitions() | Set the statuses a card may move to | array|Closure $transitions |
lockCardUsing() | Decide, per record, whether a card is locked | Closure $callback |
lockedIcon() | Set the icon shown on a locked card | bool|Closure|ScalableIcon $icon = true |
lockedLabel() | Set the label shown on a locked card | string|Closure $label = true |
modifyRecordQueryUsing() | Modify the query for this column's records | Closure $callback |
Reading the configuration
Useful when you write your own action or hook and need what the board was configured with.
| Method | Returns |
|---|---|
getStatusField() | The status field name |
getOrderField() | The order field name, or null when reordering is off |
isReorderable() | Whether orderField() was set |
getQuery() | The configured base query, with your modifyQueryUsing() applied |
RecordPosition::GAP | The gap between two positions — 1.0 |
RecordPosition::between() | The position between two neighbours — (?float $previous, ?float $next): float |
Page hooks
Override these on the class that extends KanbanPage.
| Hook | Fires when | Signature |
|---|---|---|
beforeRecordMove() | Before a card changes column | (string $newStatus, Model $record): void |
handleRecordMove() | Instead of the default status write | (string $newStatus, Model $record): void |
afterRecordMove() | After a card changed column | (mixed $oldStatus, string $newStatus, Model $record): void |
beforeRecordReorder() | Before a card moves within its column | (float $position, Model $record): void |
handleRecordReorder() | Instead of the default position write | (float $position, Model $record): void |
afterRecordReorder() | After a card moved within its column | (float $position, Model $record): void |
Render hooks
| Hook | Location |
|---|---|
KanbanRenderHook::KANBAN_SEARCH_BEFORE | Above the search bar |
KanbanRenderHook::KANBAN_PAGE_FOOTER | Bottom of the page |