- What does mrpunyapal/filament-infinite-select do for large option lists?
- It adds a Filament v4 form field that subclasses the native Select and loads options asynchronously with infinite scroll, so users search and page through large datasets without every option being sent to the browser. The package owns the interaction pattern while your application owns the query, authorization scoping, and search semantics behind a single closure. It is intended as a per-field replacement for Select::make()->searchable(), not a rewrite of your forms.
- How do I install filament-infinite-select in a Laravel Filament panel?
- Install it with Composer using composer require mrpunyapal/filament-infinite-select, then run php artisan filament:assets so the published Alpine component is available. In a Filament v4 panel you use InfiniteSelect::make('field') in place of Select::make('field') and supply a getPaginatedOptionsUsing closure. There is no separate service, schema change, queue, or JavaScript toolchain to operate on the host side.
- What must getPaginatedOptionsUsing return, and how does pagination work?
- The closure receives ($offset, $limit, $search) and must return an options value-to-label map plus a hasMore boolean indicating whether another page exists. The field calls it per scroll request, so the closure should apply authorization scoping, search rules, and query limits. Use the limit plus one pattern to compute hasMore rather than a separate count() query, which the first documented example uses and doubles round-trips per page.
- Why does my edit form show raw IDs instead of option labels?
- Loaded pages do not guarantee that a previously saved value is present, so without a label resolver Filament renders the raw ID for existing records. Implement getOptionLabelUsing() for single values and getOptionLabelsUsing() for multiple values to resolve saved IDs to labels. This is a data-quality requirement for edit forms, not a cosmetic option.
- Which Laravel and Filament versions does filament-infinite-select support?
- The package targets PHP 8.x, Laravel 10 through 12, and Filament v4 panels, with Alpine supplied by Filament. The stated support matrix does not go beyond Filament v4, so a Filament minor or major bump should be treated as untested until staging proves it. Filament v3 support is not stated and should be confirmed with the maintainer if you need it.
- How do I change page size, search debounce, preload, and scroll threshold?
- The field exposes fluent configuration: perPage() defaults to 15, searchDebounce() defaults to 300ms, scrollThreshold() defaults to 50px, and preloadFirstPage() loads the initial page. Chain these calls on the InfiniteSelect instance in your form schema. Keep page size modest and enforce a server-side cap in the closure to bound request amplification.
- Does filament-infinite-select work inside modals, repeaters, and relation managers?
- The package is built as a Filament form field and Alpine component, but selector scope and asset loading can differ inside modals, repeaters, and nested relation managers. You should test those contexts explicitly because the field subclasses Select and the published asset must be present. If an asset 404 occurs, the select may render but silently never load options.
- What are the performance risks of offset pagination and LIKE search in this field?
- Offset pagination can drift when rows are inserted or deleted mid-session, producing duplicated or skipped options and potentially a stale label against a saved record; that is usually acceptable for admin tooling but not audit-sensitive surfaces. An unindexed LIKE '%term%' search can turn a payload win into a query-cost regression. Add appropriate indexes, require a minimum search length, and enforce a server-side page cap in the closure.
- How do I deploy and test filament-infinite-select without broken assets?
- Run php artisan filament:assets on every deploy that can change the package version, because a 404 on the published asset path produces a select that renders and never loads. In tests, assert that exists and required validation still fire against the submitted ID and that your closure returns the expected map and hasMore flag. Also test edit forms with saved values to confirm label resolution.
- Is filament-infinite-select production-ready, and what should I consider before adopting it?
- It is a narrow Filament v4 field with a small integration surface, but adoption signal is thin: around 10 stars, 0 dependents, one maintainer, and no community-vetted edge-case library. Use it where a native searchable Select is insufficient, treat rollback to Select::make()->searchable() as straightforward, and confirm the maintainer's cadence against Filament majors. For audit-sensitive or high-risk surfaces, weigh the offset-pagination drift and single-maintainer risk against the UX gain.