Skip to content

Cards ​

php
$kanban
    ->titleAttribute('title')
    ->cardDescription(fn (Task $record): ?string => $record->summary)
    ->cardColor(fn (Task $record): Phase => $record->phase)
    ->cardBadges(fn (Task $record): array => [$record->priority, 'Blocked' => 'danger'])
    ->cardDate('due_at')
    ->cardProgress('progress')
    ->cardAvatars(fn (Task $record): iterable => $record->assignees)
    ->cardStats(fn (Task $record): array => [
        Stat::make('Subtasks', "{$record->done}/{$record->total}")->icon(Heroicon::OutlinedCheckCircle),
        Stat::make('Comments', $record->comments_count)->icon(Heroicon::OutlinedChatBubbleLeft),
        'Points' => $record->points,
    ]);
MethodWhat it shows
cardDescription()Two lines of plain text. RichEditor HTML is accepted and shown in full in the card view.
cardColor()A coloured dot. A HasLabel enum also names the card's category.
cardBadges()Enums with their colour and icon, or label => colour pairs.
cardDate()"tomorrow", "in 3 days", red once overdue.
cardProgress()0–100, drawn along the card's bottom edge.
cardAvatars()Models or names.
cardStats()Stat objects or label => value pairs, with icons.

Rules of thumb ​

  • Details with an empty value are skipped.
  • With swimlanes on, an avatar that repeats the lane's owner is hidden.
  • A card in the last column is never marked overdue.