Search
Basic version, Search

Sponsor version, SearchList
Please 💗 sponsor this package 🔗 in order to get access to this field. The documentation is available in the sponsor repository.

1. Add the search RESULT and INPUT properties
Use unique property names if adding multiple search fields to the same component
2. Populate the properties
It is required to set the initial/existing values, if you use the ->default() method on the field. Read more examples on how to populate the $options on the Relations page
3. Add reactivity to the search input
Update search RESULT when search INPUT changes, using the updatedFoo() hook.
4. Define the field
Follow the instructions on the Component tab, and add this to your blade view
Methods
->options($options) - search RESULT
The component property that contains the search result.
A key => value based Array, Collection or Closure.
->searchKey(string $property) - search INPUT
string $property) - search INPUTThe property that is bound to the search input
->default(mixed $value)
If you set a default value, make sure it exists in the search result property.
->disabled()
The value of $searchKey will will be displayed if the field is disabled and current field value isn't available in the initial $field->options()
This is how it is implemented in the blade file:
->debounce(int $milliseconds)
debounce the search input
default =
500
->listWidth(string $class)
the width of the search result dropdown
default =
null
Last updated
Was this helpful?