PHP code example of xentixar / dynamic-table

1. Go to this page and download the library: Download xentixar/dynamic-table 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/ */

    

xentixar / dynamic-table example snippets


use Filament\Tables\Table;

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

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

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

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

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
}