Board view
Records as cards in columns of a choice – the status of tasks, the stage of deals. Moving a card to another column changes the value. The board is a view next to the table, with the same filters, search, sorting, cards and actions.
public function form(Form $form): Form{ return $form->schema([ TextInput::make('title')->required(), Select::make('status')->options(self::STATUSES)->required(), // … ]);}
public function collection(Collection $collection): Collection{ return $collection ->columns([ TextColumn::make('title')->sortable()->searchable(), SelectColumn::make('status')->sortable(), ImageColumn::make('owner_id')->label('Responsible')->user(), TextColumn::make('due_on')->date(), ]) ->card(title: 'title', meta: ['due_on', 'owner_id']) ->views([Collection::VIEW_TABLE, Collection::VIEW_BOARD]) ->board(column: 'status', limits: ['active' => 3], collapsed: ['done']);}Settings
Section titled “Settings”| Argument | Default | Meaning |
|---|---|---|
column |
– | the field whose values are the columns of the board |
limits |
none | work in progress limits: value => number of cards; the column shows a warning when it has as many or more, moving is not blocked |
collapsed |
none | values whose column shows its cards only when opened, e.g. done |
The board column must be a SelectColumn
of the collection with a Select of the same name in the form; otherwise
rendering the board throws a LogicException. Collection::VIEW_BOARD in
views() without board() throws one as well.
Columns and cards
Section titled “Columns and cards”- One column per option of the
Select, in the order of the options. Records without a value get a column of their own when there are any. - Cards look like in the card view: title, badges, meta,
rows and fields of
card(), and the actions of the record. - Search, filters and sorting of the list apply to every column. Each column shows up to per page cards and the number of all of them; + n more raises the page size. There are no pages.
- Grouping does not apply to the board; the board is not offered in related lists.
Moving cards
Section titled “Moving cards”Cards are dragged to another column, or moved with the Move menu of the
card – with the keyboard as well. Both send the same
request as the choice of the SelectColumn in the table, so the same
rules apply:
- the update permission and the policies of the record;
disabledWhen()andoptionsPerRecord()of the column; cards that cannot be moved cannot be dragged and have no menu;- the validation rules of the field;
- a card changed by someone else since the board was loaded is refused (422) and the board is reloaded;
- the change is saved with
Resource::updateColumn()and written to the audit log.
The new column is announced as a notification. A column holding the state of a workflow cannot be a board column: only transitions change the state.