kisame76/filament-db-table-state
Persist Filament table state (filters, sorting, search, pagination) in the database so users keep their preferred view between visits. Lightweight Laravel package for per-user table preferences across resources and sessions.
FilamentDbTableStateServiceProvider).config/filament-db-table-state.php.Table or Resource\Table) with the trait HasDbTableState.filament_db_table_states). Schema changes (e.g., adding new state fields) may need manual adjustments.| Risk | Severity | Mitigation |
|---|---|---|
| Filament Version Drift | High | Pin Filament version in composer.json and test upgrades in a staging environment. |
| Performance Overhead | Medium | Benchmark DB queries for large tables; consider caching state for anonymous users. |
| State Serialization | Medium | Validate that custom table configurations (e.g., complex filters) serialize correctly. |
| Concurrency Issues | Low | Use database transactions for state updates if multiple users edit the same table simultaneously. |
| Vendor Lock-in | Low | Abstract state logic behind interfaces if future migration to another admin panel is needed. |
composer require kisame76/filament-db-table-state
php artisan vendor:publish --provider="Kisame76\FilamentDbTableState\FilamentDbTableStateServiceProvider"
php artisan migrate
config/filament-db-table-state.php with table-state mappings.filament/filament: ^3.0).ToggleColumn, SelectColumn).filament-spatie-laravel-permission).Table class with HasDbTableState.columns, sort, filters) in the config.archived_at to state table).filament_db_table_states in database backups; test restores.user_id not found).user_id index if querying by user).HasDbTableState trait is applied and config is correct.JsonSerializable.tinker to inspect state records:
\Kisame76\FilamentDbTableState\Models\TableState::where('table', 'users')->get();
How can I help you explore Laravel packages today?