PHPackages                             glebred/search-multiselect-input - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. glebred/search-multiselect-input

ActiveLibrary[Search &amp; Filtering](/categories/search)

glebred/search-multiselect-input
================================

Searchable multiple select input for Livewire Laravel 8

1.0.8(3y ago)101.1k2MITPHPPHP ^7.3|^8.0

Since Feb 24Pushed 3y ago2 watchersCompare

[ Source](https://github.com/GlebRed/Livewire-Search-Multiselect-Input)[ Packagist](https://packagist.org/packages/glebred/search-multiselect-input)[ RSS](/packages/glebred-search-multiselect-input/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (8)Dependencies (4)Versions (10)Used By (0)

Livewire Searchable Multiselect Input
=====================================

[](#livewire-searchable-multiselect-input)

Livewire component for searchable multiselect input with **dynamic** data source

### Preview

[](#preview)

[![preview](https://github.com/GlebRed/Livewire-Search-Multiselect-Input/raw/master/preview.gif)](https://github.com/GlebRed/Livewire-Search-Multiselect-Input/raw/master/preview.gif)

### Installation

[](#installation)

Install the package via composer:

```
composer require glebred/search-multiselect-input
```

Publish the view

```
php artisan vendor:publish --provider="GlebRed\SearchMultiselectInput\SearchMultiselectInputServiceProvider" --tag="views"
```

You will find that new view in `views/vendor/search_multiselect_input/components`

### Requirements

[](#requirements)

This package uses `livewire/livewire` () under the hood.

It also uses TailwindCSS () for base styling.

Please make sure you include both of these dependencies before using this component.

### Usage

[](#usage)

In order to use this component, you must create a new Livewire component that extends from `SearchMultiselectInput`

You can use `make:livewire` to create a new component. For example.

```
php artisan make:livewire MyMultiInput --inline
```

In the `MyMultiInput` class, instead of extending from the base Livewire `Component` class, extend from `SearchMultiselectInput` class. Also, remove the `render` method.

```
use GlebRed\SearchMultiselectInput\SearchMultiselectInput;

class MyMultiInput extends SearchMultiselectInput
{
    //
}
```

In this class, you must implement the following methods to configure data sources. For instance, here I'm getting data from my User model

```
public function updatedQuery()
{
    $this->data = User::where('name', 'like', '%' . $this->query . '%')
        ->get()
        ->toArray();
}

public function addSelectedItem($user_id)
{
    $user = User::findOrFail($user_id, ['id', 'name']);

    if (!empty($this->selected_items)) {
        if (!in_array($user['id'], array_column($this->selected_items, 'id'))) $this->selected_items[] = $user;
    } else {
        $this->selected_items[] = $user;
    }

    //Emit selected items to parent's participantsChanged($participants)
    $this->emit('participantsChanged', $this->selected_items);

    $this->resetProps();
}

public function removeSelectedItem($id)
{
    foreach ($this->selected_items as $key => $item) {
      if ($item['id'] == $id) {
        unset($this->selected_items[$key]);
        break;
      }
    }

    //Emit selected items to parent's participantsChanged($participants)
    $this->emit('participantsChanged', $this->selected_items);
}
```

To render the component in a view, just use the Livewire tag or include syntax

```
@livewire('my-multi-input')
```

Or if you want to pass parameters for an edit form then

```
@livewire('my-multi-input', [$selected_items])
```

And then in your MyMultiInput.php

```
public function mount($selected_items)
{
    $this->selected_items = $selected_items;
}
```

### Advanced behavior

[](#advanced-behavior)

// TODO 😬

### AlpineJs support

[](#alpinejs-support)

Add AlpineJs for arrow-keys navigation, enter key for selection, enter/space keys for reset. 😎

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Gleb Redko](https://github.com/glebred)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~75 days

Recently: every ~148 days

Total

9

Last Release

1302d ago

PHP version history (2 changes)1.0.0PHP ^7.3

1.0.7PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7557b692f5a8d130d136c2cb78a063950dfbf351b4c96ebe469f9baacf6ec508?d=identicon)[glebred](/maintainers/glebred)

---

Top Contributors

[![GlenRed](https://avatars.githubusercontent.com/u/5457876?v=4)](https://github.com/GlenRed "GlenRed (15 commits)")

---

Tags

searchlivewire-selectglebred

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/glebred-search-multiselect-input/health.svg)

```
[![Health](https://phpackages.com/badges/glebred-search-multiselect-input/health.svg)](https://phpackages.com/packages/glebred-search-multiselect-input)
```

###  Alternatives

[mailerlite/laravel-elasticsearch

An easy way to use the official PHP ElasticSearch client in your Laravel applications.

934529.3k2](/packages/mailerlite-laravel-elasticsearch)[teamtnt/laravel-scout-tntsearch-driver

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

1.1k2.5M28](/packages/teamtnt-laravel-scout-tntsearch-driver)[algolia/scout-extended

Scout Extended extends Laravel Scout adding algolia-specific features

4186.3M6](/packages/algolia-scout-extended)[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

397612.3k](/packages/jeroen-g-explorer)[typesense/laravel-scout-typesense-driver

Laravel Scout Driver for Typesense

144637.2k3](/packages/typesense-laravel-scout-typesense-driver)[devnoiseconsulting/laravel-scout-postgres-tsvector

PostgreSQL Full Text Search Driver for Laravel Scout

58110.1k](/packages/devnoiseconsulting-laravel-scout-postgres-tsvector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
