razorcreations/ajax-field
A Laravel Nova field that loads and updates its options over AJAX, making it easy to build dependent form fields—such as country/state or category/subcategory selects—where one field's value triggers a server request to refresh another's contents.
BelongsTo::make()->searchable()).Consider it only when all of the following hold:
exists: validation stay untouched, so model events and Nova's BelongsTo display path keep working.Field.vue, and cap results server-side. A permissive search route is the single most realistic data-leak failure mode here.Look elsewhere or build in-house when:
For executives: This is a small, reversible improvement to the internal admin panel, not a platform bet. Operations staff currently pick from dropdowns that render thousands of options; this field replaces them with type-ahead search that loads results on demand. Expected impact — faster form loads and fewer data-entry mistakes in back-office workflows — is visible in days, not a quarter. Cost is a short timeboxed pilot on one or two resources, with a clear kill criteria if the metrics don't move. The main risk isn't technical; it's a lightly maintained third-party dependency, which we mitigate with a version pin, a named internal owner, and a fallback to Nova's native searchable field. Worst case, we fork it in a morning or revert.
For engineering: It's a Nova field that fetches select options over AJAX instead of rendering them server-side. That shifts load from page render to a search endpoint — it doesn't delete it. Before rollout we need three things confirmed: the route sits behind Nova's middleware (otherwise intermittent 419/403 after session rotation), the controller caps results and selects only the columns it returns, and Field.vue debounces keystrokes and cancels stale requests. The failure mode to watch for is a silently empty dropdown — a 200 with the wrong JSON shape looks identical to "no matches" — so debug the route and payload before touching the query. Also budget for indexing: leading-wildcard LIKE '%term%' can't use a B-tree index, which is invisible at small scale and painful at hundreds of thousands of rows.
How can I help you explore Laravel packages today?