A Laravel Nova text autocomplete field.
gkermer/nova-text-auto-complete is a Laravel package for a laravel nova text autocomplete field..
It currently has 22 GitHub stars and 116.211 downloads on Packagist (latest version 0.0.5).
Install it with composer require gkermer/nova-text-auto-complete.
Discover more Laravel packages by gkermer
or browse all Laravel packages to compare alternatives.
Last updated
This Nova field provides a capability of auto-completed searching for results inside a text input field.

You can install the Nova field in to a Laravel app that uses Nova via composer:
composer require gkermer/nova-text-auto-complete
To add an autocomplete text field, use the Gkermer\TextAutoComplete\TextAutoComplete field in your Nova resource:
use Gkermer\TextAutoComplete\TextAutoComplete;
TextAutoComplete::make('Favourite Fruit')->items([
'Apple',
'Apricots',
'Avocado',
'Banana',
'Blueberries',
]),
Assuming you have an Eloquent model Fruit with attribute name, you could get the items by:
TextAutoComplete::make('Favourite Fruit')->items(
Fruit::pluck('name')
),
However, imagine the Fruit has hundreds or thousands records and the drop-down selection menu is populated with so many items. Then you could find the items like so:
TextAutoComplete::make('Favourite Fruit')->items(function($search) {
return Fruit::where('name', 'like', '%' . $search . '%')
->get()
->pluck('name');
}),
The MIT License (MIT). Please see License File for more information.