Skip to main content
Keep your existing Resource and save flow. This recipe stores one integer user ID in an existing nullable assignee_id foreign key. Labels and dropdown HTML are not stored. Your application owns that column, its foreign key and assignment policy.

Prerequisites

An authenticated Filament panel with FLEX registered, an Eloquent user model with integer keys and a name attribute, and an application query describing exactly which users the current actor may assign. The example below assumes your application already has a team_id scope and denies access without a team. Replace that query with your real policy; do not add a team column just to copy it. Pagination bounds the database result. Virtualization bounds the mounted rows. Neither grants permission to a record. Submitted IDs and selected labels must use the same access scope as search, including when the form is inside a modal.

Copy the application helper

The full file ships in resources/recipes/scoped-select. It is opt-in application code, not a new FLEX API or a generated database migration.
app/Support/AssigneePicker.php

Use it in an existing schema

Rebuild the scope from the authenticated server context on every request. Do not accept a team ID or SQL scope from public Livewire state. Add appropriate indexes for your real dataset and query plan; prefix matching and collation vary by DB. The cursor is a last-seen integer key, not an authorization token. Reset it when the search changes. These examples are not intended for UUID keys or relevance ordering without adapting the cursor contract.

Save and reopen

Use the Resource’s normal validated save. A custom Livewire form uses fill() and getState() as described in Saving & validation. Do not silently remove the helper’s validation rule when adding domain rules. The package tests execute the shipped query helper against a 10,000-row SQLite fixture. That is a query and validation check, not a promise about your database’s query time or all-device frame rates. Measure your actual query plan and page. See Select configuration for rendering, keyboard behavior, rate limits and mobile sheets.
Last modified on October 17, 2026