guava / filament-icon-select-column
Adds a icon select (via dropdown) column to your filament tables.
Package info
github.com/GuavaCZ/filament-icon-select-column
pkg:composer/guava/filament-icon-select-column
Fund package maintenance!
Requires
- php: ^8.2
- filament/filament: ^5.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8|^8.1
- nunomaduro/larastan: ^2.0.1
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
README
Icon Select Column for your filament tables
This plugin adds an editable icon column to your filament tables. The cell renders the current state as an icon, and clicking it opens a dropdown where the user picks a new state, again represented by icons. The selection is saved straight to the record, like filament's own SelectColumn.
This is useful for quickly toggling states directly from a table, for example a status, a priority or a rating, without opening the edit page.
Documentation
The full documentation is available at guava.cz.
Version compatibility
| Filament version | Plugin version |
|---|---|
| 3.x | 1.x |
| 4.x | 2.x |
| 5.x | 3.x |
For older filament versions, please check the branch of the respective version.
Showcase
Installation
You can install the package via composer:
composer require guava/filament-icon-select-column
Next, publish the package assets:
php artisan filament:assets
Finally, make sure you have a custom filament theme (read here how to create one) and add the following to your theme.css file so the CSS is properly built:
@source '../../../../vendor/guava/filament-icon-select-column/resources/**/*';
Usage
Add the column to any table. It works best with a backed enum implementing HasLabel, HasIcon and optionally HasColor:
use Guava\FilamentIconSelectColumn\Tables\Columns\IconSelectColumn; $table->columns([ IconSelectColumn::make('status') ->options(Status::class), ]);
Everything else, including array options, icon sizes and closing the dropdown on selection, is covered in the documentation.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.