Download the PHP package amabk/livewire-search-select without Composer

On this page you can find all versions of the php package amabk/livewire-search-select. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package livewire-search-select

Livewire Search Select

A powerful and customizable Livewire component for searchable select dropdowns. Supports multi-field labels, concatenation, and emits Livewire events for reactive parent handling.


Usage

1. Installation

Install via Composer:

2. Basic Usage

Add the component to any Blade view:

Single-select

Multi-select (chips inside field)

Custom separators

Prop Type Default Notes
modelClass string Eloquent model FQCN, e.g. \App\Models\User
labelFields array<string> | string ['email'] Fields used to render the visible label
searchFields array<string> ['name'] Fields used for LIKE search
concatFields bool false If true, search uses CONCAT_WS(searchSeparator, …)
labelSeparator string ' ' Separator when rendering labels (display only)
searchSeparator string ' ' Separator used in CONCAT_WS when concatFields=true
orderBy {field:string, direction:'asc' \| 'desc'} { field: 'id', direction: 'asc' } Sort for initial and searched results
limit int 10 Max rows for search results
initialLoad int 0 Prefetch N items on focus when search is empty
placeholder string 'Search...' Hidden when chips exist (multi)
emitEvent string \| null null Event name to dispatch on change
inputClass string '' Extra classes on the wrapper (the chip field)
optionClass string '' Extra classes on the dropdown <ul>
multiple bool false Enable multi-select
selectedId int \| null null Preselect for single-select
selectedIds int[] [] Preselect for multi-select

3. Listening for Selection Events

When a user selects an option, the component emits a Livewire event (named by your emit-event prop) to the parent component. You can listen for it and update your parent Livewire component’s data accordingly.

Example Parent Component:

In your Blade view:


4. Customizing Appearance

You can pass custom CSS classes to the input and the options list:


5. Setting a Default Selected Option

To set a default selection:

This will preselect the items with id = 5 and id = 9 and show their labels in the input.


6. Troubleshooting & Tips


7. Development

8. Example: User Dropdown in a Form


10. Advanced: Use With Any Model & Any Label Format


For advanced use, extend the component in your own package. For issues, open a GitHub issue or PR!

License

MIT © AMABK


All versions of livewire-search-select with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
livewire/livewire Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package amabk/livewire-search-select contains the following files

Loading the files please wait ....