finity-labs/fin-modal-table-select

ModalTableSelect for Filament with rich selected-item displays (table, cards, stacked list), form prefill, and repeater sync

Maintainers

Package info

github.com/finity-labs/fin-modal-table-select

pkg:composer/finity-labs/fin-modal-table-select

Transparency log

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-08-12 13:22 UTC

This package is auto-updated.

Last update: 2026-08-15 09:22:15 UTC


README

finity-labs-fin-modal-table-select

FILAMENT 4.x FILAMENT 5.x Latest Version on Packagist Tests Code Style Total Downloads License

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 modal table select open over the invoice form, with rows checked

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:

Table-layout repeater filled from the selection, with editable quantity and price

Prefilled invoice headerfillsFields() fills read-only entries and an editable phone from the picked company:

Company picker prefilling name, tax number, and an editable phone

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:

Badges with display limit, stacked list, and inherited-column table displays Text lists, per-record badges, card grid, thumbnails, and custom item views

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