finity-labs / fin-modal-table-select
ModalTableSelect for Filament with rich selected-item displays (table, cards, stacked list), form prefill, and repeater sync
Package info
github.com/finity-labs/fin-modal-table-select
pkg:composer/finity-labs/fin-modal-table-select
Requires
- php: ^8.2
- filament/filament: ^4.0|^5.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.0|^3.0
- laravel/pint: ^1.0
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^2.0|^3.0
- pestphp/pest-plugin-laravel: ^2.0|^3.0
README
A drop-in replacement for Filament's native ModalTableSelect that shows what you've selected — and can push the selection into the rest of your form.
The stock component renders the selection as badges or comma-separated text. This one adds:
- Nine display modes — a table with columns inherited from your modal's
tableConfiguration(), a stacked list with per-item remove, a card grid, a thumbnail strip, per-record badge colors/icons, text lists, an infolist card, your own Blade view per item, or nothing at all (selection-only). The mode resolves automatically from what you configure. fillsFields()— pick a company, get its name and tax number filled in, let the user overwrite the phone.fillsRepeater()+SelectedItemsRepeater— pick products, get one editable row each (quantity, price). Re-picking never wipes what the user edited, and deleting a row deselects its record.standalone()— use the picker without an Eloquent relationship; selected IDs land in a JSON column.
Everything user-facing stays stock Filament — the modal, the row entries, the repeater. This package only wires them together. All display modes support dark mode out of the box, and 58 locales ship with the package.
Screenshots
Pick records in a full Filament table — search, sort, and filter inside the modal; the selection summary badge sits right on the field label:
The invoice flow — every picked product becomes an editable repeater row (fillsRepeater() + SelectedItemsRepeater). Re-picking keeps your edited quantities and prices; deleting a row deselects the product:
Prefilled invoice header — fillsFields() fills read-only entries and an editable phone from the picked company:
Nine ways to show the selection — badges with displayLimit(), stacked lists with per-item remove, inherited-column tables, text lists, per-record badge colors, card grids, thumbnails, and your own Blade view per item:
Quick example
use FinityLabs\FinModalTableSelect\Components\ModalTableSelect; // Selected records as a table, columns inherited from the modal: ModalTableSelect::make('categories') ->relationship('categories', 'name') ->multiple() ->tableConfiguration(CategoriesTable::class) ->displayAsTable() // Invoice lines: pick products, edit quantity/price per row: ModalTableSelect::make('product_picker') ->standalone(Product::class, 'name') ->multiple() ->tableConfiguration(ProductsTable::class) ->selectionOnly() ->fillsRepeater('items', fn (Product $record): array => [ 'product_id' => $record->getKey(), 'name' => $record->name, 'unit_price' => $record->default_price, 'quantity' => 1, ], keyAttribute: 'product_id')
Installation
composer require finity-labs/fin-modal-table-select
Custom Filament theme? Add the package views to your theme's @source list — see Installation.
Documentation
| Guide | Covers |
|---|---|
| Installation | Requirements, Tailwind setup, translations |
| Getting started | Concepts, display-mode resolution, 30-second tour |
| Display modes | Table, stacked list, cards, thumbnails, badges, lists, infolist, custom views |
| Filling form fields | fillsFields() — prefill an invoice header from a company |
| Filling a repeater | fillsRepeater() + SelectedItemsRepeater — the invoice-lines flow |
| Standalone mode | Using the picker without a relationship |
| Reference | Full API table, public methods, translation keys |
Compatibility
| Package | Filament | PHP |
|---|---|---|
| 1.x | 4.x / 5.x | 8.2+ |
License
MIT