1. Go to this page and download the library: Download packstub/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/ */
packstub / filament-kanban example snippets
use App\Enums\DealStage;
use App\Models\Deal;
use Packstub\Kanban\Board;
use Packstub\Kanban\Card;
use Packstub\Kanban\Pages\KanbanResourcePage;
class DealBoard extends KanbanResourcePage
{
protected static string $resource = DealResource::class;
public function kanban(Board $board): Board
{
return $board
->query(fn () => Deal::query()->with('owner'))
->columnAttribute('stage')
->columns(DealStage::class)
->card(fn (Deal $deal) => Card::make()
->eyebrow($deal->reference)
->title($deal->company)
->aside(Number::currency($deal->amount, 'USD'))
->meta([$deal->title, $deal->close_at?->format('M j')])
->avatar($deal->owner?->avatar_url, $deal->owner?->name));
}
}
->moveUsing(function (Deal $deal, string $to, string $from) {
if ($to === 'won' && ! $deal->contract_signed) {
throw new \RuntimeException('Attach the signed contract first.');
}
$deal->update(['stage' => $to]);
})
$board
->reorderable('sort') // users order cards inside a column
->sortBy('due_at') // default order (a column can override it)
->poll('30s') // pick up other people's changes
->focusMode(false) // keep the panel's sidebar on the board page
->key('deals'); // where the browser remembers folded and hidden columns
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.