Download the PHP package dpsoft/nova-multiselect-filter without Composer
On this page you can find all versions of the php package dpsoft/nova-multiselect-filter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dpsoft/nova-multiselect-filter
More information about dpsoft/nova-multiselect-filter
Files in dpsoft/nova-multiselect-filter
Package nova-multiselect-filter
Short Description Multiselect filter and field for Laravel Nova.
License MIT
Informations about the package nova-multiselect-filter
Nova Multiselect Filter & Field with ajax
This Laravel Nova package adds a multiselect to Nova's filters and form fields.
Requirements
laravel/nova: ^3.0
Features
- Multi select
- Single select
- Group select
- Search
- Filter and Field
Installation
Install the package in a Laravel Nova project via Composer:
Usage
As a Filter
The filter can be used when switching Filter class with MultiselectFilter.
As a Form Field
The field can be used in Nova resources for form input:
Built-in server-side search endpoint
Option groups
Option groups are supported. Their syntax is the same as Laravel's option group syntax.
In this example (from Nova docs), all values are grouped by the group key:
Options
Possible options you can pass to the filter using the option name as a function, ie ->placeholder('Choose peanuts').
| Option | type | default | description |
|---|---|---|---|
options |
Array|callable | [] | Options in an array as key-value pairs (['id' => 'value']). |
placeholder |
String | Field name | The placeholder string for the input. |
max |
Number | Infinite | The maximum number of options a user can select. |
groupSelect |
Boolean | false | For use with option groups - allows the user to select whole groups at once |
singleSelect |
Boolean | false | Makes the field act as a single select which also means the saved value will not be an array. |
optionsLimit |
Number | 1000 | The maximum number of options displayed at once. Other options are still accessible through searching. |
ajaxEndpoint |
String | null | Custom endpoint to search and return options for async search. Defaults to /nova-vendor/nova-multiselect-filter/search. |
ajaxMethod |
String | get | Request method for async search. |
ajaxParam |
String | search | Query param name for the search term. |
debounce |
Number | 300 | Debounce in milliseconds for async search. |
minChars |
Number | 0 | Minimum characters before search triggers. |
model |
String | null | Fully qualified model class name used by the built-in search endpoint. |
searchColumn |
String | null | Column name used by the built-in search endpoint. |
limit |
Number | null | The number of options to return from a server-side search. |
Credits
This package was inspired by klepak/nova-multiselect-filter
License
This project is open-sourced software licensed under the MIT license.