Download the PHP package rishadblack/wire-tomselect without Composer
On this page you can find all versions of the php package rishadblack/wire-tomselect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rishadblack/wire-tomselect
More information about rishadblack/wire-tomselect
Files in rishadblack/wire-tomselect
Package wire-tomselect
Short Description Tom Select
License MIT
Homepage https://github.com/rishadblack/wire-tomselect
Informations about the package wire-tomselect
WireTomSelect - Laravel Livewire Searchable Dropdown
WireTomSelect is a reusable, customizable Livewire component designed for implementing searchable dropdowns with minimal effort in Laravel projects. It provides a clean interface to query data, map results, and handle user selections.
Features
- Easy integration with Laravel Livewire.
- Configurable search, label, and value fields.
- Supports single and multiple selections.
- Customizable query logic.
- Placeholder, disabled state, and max options settings.
Installation
Step 1: Install the Package
You can install the package via Composer:
Step 2: Publish the Views
If you need to customize the default views, you can publish them:
This will publish the wire-tomselect::search
view to your resources/views/vendor
directory.
Usage
Step 1: Extend the SearchComponent
To create your searchable dropdown component, extend the abstract SearchComponent
class and define the required builder
and configure
methods.
Step 2: Use the Component in a Blade File
Include your component in a Blade file as follows:
Customization
Configure Fields
- Value Field: Field used for the dropdown value (default:
id
). - Label Field: Field used for the dropdown label (default:
name
).
Set these fields in your configure
method:
Search Fields
Specify the fields for performing searches using:
Maximum Options
Set the maximum number of options to display using:
Example
Here’s a complete example for creating a searchable product dropdown:
In your Blade template:
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch.
- Submit a pull request with a detailed description of your changes.
License
This package is open-sourced software licensed under the MIT license.
Feel free to adapt this documentation based on your repository's specific needs!