Download the PHP package defstudio/filament-searchable-input without Composer
On this page you can find all versions of the php package defstudio/filament-searchable-input. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download defstudio/filament-searchable-input
More information about defstudio/filament-searchable-input
Files in defstudio/filament-searchable-input
Package filament-searchable-input
Short Description A searchable autocomplete input for Filament forms
License MIT
Homepage https://github.com/defstudio/filament-searchable-input
Informations about the package filament-searchable-input
Filament Searchable Input
A searchable autocomplete input for Filament
Filament Compatibility
Package Version | Filament Version |
---|---|
1.x | 3.x |
4.x | 4.x |
Installation
You can install the package via composer:
[!IMPORTANT] If you have not set up a custom theme and are using Filament Panels follow the instructions in the Filament Docs first.
After setting up a custom theme add the plugin's views to your theme css file or your app's css file if using the standalone packages.
Views customization
Optionally, you can publish the views using
Usage
SearchableInput
is a component input built on top of TextInput, so any TextInput method is available, plus it allows to define a search function that will be executed whenever the user types something.
Here's a basic implementation
Value-Label pairs options
Options can be defined also as an array of Value and Label pairs.
The Value
will be inserted in the Input field when the user select an item. The Label
is just used as a display value inside the search dropdown.
Custom Search Function
Instead (or along with) defining an ->options()
set, the search result set can be customized:
Complex Items
SearchableInput
supports using arrays as search results, this allows to pass metadata to the selected item and consume it in the ->onItemSelected()
method:
Filament Utility Injection
In each of its methods, SearchableInput
fully supports Filament utility injection in its methods, like:
Upgrading
From v1.x (Filament v3) to v4.x (Filament v4)
With Filament v4 it has been recommended for plugin authors to have the users include their plugins views in a custom theme, rather than include the built css from the plugin. So for upgrades from Filament v3 to v4 it is recommended to follow these instructions from Filament Docs to set up a custom theme (if not already done) and add this to your theme/app css file
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Fabio Ivona
- Mario Gattolla
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-searchable-input with dependencies
filament/filament Version ^4.0
filament/forms Version ^4.0
spatie/laravel-package-tools Version ^1.15