1. Go to this page and download the library: Download asignua/filament-kanban library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
asignua / filament-kanban example snippets
use Asignua\FilamentKanban\KanbanPlugin;
$panel->plugin(KanbanPlugin::make());
use Asignua\FilamentKanban\Concerns\IsKanbanStatus;
use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasIcon;
use Filament\Support\Contracts\HasLabel;
enum TaskStatus: string implements HasColor, HasIcon, HasLabel
{
use IsKanbanStatus;
case Todo = 'todo';
case Doing = 'doing';
case Done = 'done';
public function getLabel(): string { return ucfirst($this->value); }
public function getColor(): string { return match ($this) { self::Todo => 'gray', self::Doing => 'warning', self::Done => 'success' }; }
public function getIcon(): string { return 'heroicon-m-bolt'; }
}
use Asignua\FilamentKanban\Pages\KanbanBoard;
class TasksBoard extends KanbanBoard
{
protected static string $model = Task::class;
protected static string $statusEnum = TaskStatus::class;
protected static string $recordStatusAttribute = 'status'; // default
protected static string $recordTitleAttribute = 'title'; // default
protected static ?string $recordSortAttribute = 'position'; // where the manual order is stored; null = not stored
}
protected function recordTitle(Model $record): string; // default: the title attribute
protected function recordDescription(Model $record): ?string; // grey line under the title
protected function recordBadges(Model $record, KanbanColumn $column): array; // [['label' => 'Overdue', 'color' => 'danger', 'icon' => 'heroicon-m-clock']]
protected function recordExtras(Model $record, KanbanColumn $column): array; // free markup (Htmlable)
protected function recordUrl(Model $record): ?string; // the card becomes a link, no modal
protected function recordRelations(): array; // eager loads