Seiten · Laravilt
Select
Dropdown with search, multiple selection, relationships and dependent options.
A dropdown with search, multiple selection and relationship support.
Basic usage
php
Searchable
php
Multiple selection
php
Relationships
php
Create and edit options inline
php
Dependent selects
php
Boolean select
php
API reference
| Method | Description |
|---|---|
options(array|Closure) | Set options |
searchable(bool|array) | Enable search, optionally on specific columns |
multiple(bool) | Allow multiple values |
minItems(?int) / maxItems(?int) | Selection limits for multiple mode |
relationship(name, titleAttribute, ?modifyQuery) | Load options from a relationship |
preload(bool) | Load all relationship options up front |
native(bool) | Use the native <select> element |
dependsOn(string|array) | Reload options when other fields change |
optionsLimit(int) | Limit options shown |
getSearchResultsUsing(Closure) | Custom search |
getOptionLabelUsing(Closure) | Custom label for the selected value |
createOptionForm(array) / createOptionUsing(Closure) | Inline creation |
editOptionForm(array) / updateOptionUsing(Closure) | Inline editing |
disableOptionWhen(Closure) | Disable individual options |
boolean(?true, ?false, ?placeholder) | Yes/No options |
allowHtml(bool) | Render option labels as HTML |
searchDebounce(int) | Search debounce in milliseconds |