PHP code example of guava / filament-icon-select-column

1. Go to this page and download the library: Download guava/filament-icon-select-column 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/ */

    

guava / filament-icon-select-column example snippets


use Guava\FilamentIconSelectColumn\Tables\Columns\IconSelectColumn;

$table->columns([
    IconSelectColumn::make('state')
        ->options(MyStateEnum::class)
]);

$table->columns([
    IconSelectColumn::make('state')
        ->options([
            'opt1' => 'Option 1',
            'opt2' => 'Option 2',
        ])
        ->icons([
            'opt1' => 'heroicon-o-check',
            'opt2' => 'heroicon-o-x-mark',
        ])
]);

use Guava\FilamentIconSelectColumn\Tables\Columns\IconSelectColumn;

IconSelectColumn::make('state')
    ->closeOnSelection()
    // ...