PHP code example of team-nifty-gmbh / tall-datatables
1. Go to this page and download the library: Download team-nifty-gmbh/tall-datatables 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/ */
team-nifty-gmbh / tall-datatables example snippets
class UserDataTable extends DataTable
{
protected string $model = User::class;
public array $enabledCols = ['name', 'email', 'created_at'];
}
protected function availableLayouts(): array
{
return ['table', 'grid', 'kanban'];
}
protected function availableLayouts(): array
{
return ['table', 'grid'];
}
protected function availableLayouts(): array
{
return ['table', 'kanban'];
}
// Which column determines the lanes
protected function kanbanColumn(): string
{
return 'state';
}
// Optional: explicit lane config (order, labels, colors)
protected function kanbanLanes(): ?array
{
return [
'open' => ['label' => 'Open', 'color' => 'emerald'],
'in_progress' => ['label' => 'In Progress', 'color' => 'amber'],
'done' => ['label' => 'Done', 'color' => 'indigo'],
];
}
// Handle drag & drop
public function kanbanMoveItem(int|string $id, string $targetLane): void
{
MyModel::findOrFail($id)->update(['state' => $targetLane]);
}
// Optional: custom card blade view
protected function kanbanCardView(): ?string
{
return 'components.my-kanban-card';
}
public bool $isFilterable = true;
protected function canShareFilters(): bool
{
return true;
}