承接 xentixar/dynamic-table 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xentixar/dynamic-table

最新稳定版本:v1.0.2

Composer 安装命令:

composer require xentixar/dynamic-table

包简介

README 文档

README

xentixar/dynamic-table is a Filament package that adds dynamic table behavior.

Features

  • Adds Table::liveSelection() macro for reactive selection syncing.
  • Supports optional Livewire callback method execution on selection changes.
  • Registers on both Filament Tables and Archilex Advanced Tables (if installed).

Requirements

  • PHP 8.2+
  • Filament Tables ^4.0 || ^5.0
  • Illuminate Support ^11.0 || ^12.0 || ^13.0

Installation

Install with Composer:

composer require xentixar/dynamic-table

The package uses Laravel package discovery, so the service provider is auto-registered.

Quick Start

Apply liveSelection() on your table definition:

use Filament\Tables\Table;

public static function table(Table $table): Table
{
    return $table
        ->liveSelection();
}

Usage

1) Basic usage

public static function table(Table $table): Table
{
    return $table->liveSelection();
}

2) Conditional enable/disable

public static function table(Table $table): Table
{
    return $table->liveSelection(
        condition: auth()->user()?->can('bulkSelectUsers') ?? false,
    );
}

3) Use custom Livewire property

public static function table(Table $table): Table
{
    return $table->liveSelection(
        livewireProperty: 'selectedUsers',
    );
}

4) Trigger a Livewire method on selection change

public static function table(Table $table): Table
{
    return $table->liveSelection(
        livewireMethod: 'onSelectionChanged',
    );
}

public function onSelectionChanged(
    array $selectedRecords,
    array $deselectedRecords,
    bool $isTrackingDeselectedRecords,
): void {
    // Your logic here
}

If livewireMethod is not provided, the component refreshes automatically.

API Reference

  • condition (bool, default: true)
    • Enable or disable live selection behavior.
  • livewireProperty (string, default: selectedTableRecords)
    • Livewire property used for current selection state.
  • livewireMethod (?string, default: null)
    • Optional Livewire method called when selection changes.
    • Receives (array $selectedRecords, array $deselectedRecords, bool $isTrackingDeselectedRecords).

Troubleshooting

  • Method liveSelection does not exist:
    • Run composer dump-autoload and clear app caches (php artisan optimize:clear).
  • Callback not firing:
    • Ensure the method name in livewireMethod matches exactly and is public.
  • Selection state not where expected:
    • Verify the livewireProperty name matches your component property.

License

MIT

See LICENSE for full text.

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固