PHPackages                             josedaian/select2wire - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. josedaian/select2wire

ActivePackage[Utility &amp; Helpers](/categories/utility)

josedaian/select2wire
=====================

Select2 for livewire components.

v2.0.1(2y ago)01311MITBladePHP &gt;=8.1

Since Oct 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/josedaian/select2wire)[ Packagist](https://packagist.org/packages/josedaian/select2wire)[ Docs](https://github.com/josedaian/select2wire)[ RSS](/packages/josedaian-select2wire/feed)WikiDiscussions main Synced today

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

Select2 for Livewire components
===============================

[](#select2-for-livewire-components)

[![josedaian/select2wire](https://camo.githubusercontent.com/fb738b1873e45a437c8e430f093b432175ef8ddc75b3860c3886d2ff681a6c3a/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d5061636b6167697374266d6573736167653d6a6f7365646169616e2f73656c656374327769726526636f6c6f723d626c7565266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/josedaian/select2wire)[![Laravel 10](https://camo.githubusercontent.com/f2979115655bf9fb0801ee8f39ed755c37377124367c91b00df76c2bba600fb2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302d6f72616e67652e737667)](http://laravel.com)[![Latest Stable Version](https://camo.githubusercontent.com/1dac288f1897b6ff6e42083f8fa7295d8e0a09db7099a661fbe4d9e2477f2209/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f7365646169616e2f73656c65637432776972652e737667)](https://packagist.org/packages/josedaian/select2wire)[![Total Downloads](https://camo.githubusercontent.com/17246b9ba2dc217032bda4ed8dd8b4b0ce2cc6485249744000e3e0d7ae4b3285/68747470733a2f2f706f7365722e707567782e6f72672f6a6f7365646169616e2f73656c65637432776972652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/josedaian/select2wire)[![License](https://camo.githubusercontent.com/850eae1099d2b05f53383473d7cd51f9bc1ab09b7d0d9e5122f1dd930efdcc6d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6173686170652f6170697374617475732e737667)](https://packagist.org/packages/josedaian/select2wire)[![Livewire](https://camo.githubusercontent.com/962821d1e9a83525092465d3417aa1db25706f87e3be43b73ff46e1c88ac8da3/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d4c69766577697265266d6573736167653d332e3026636f6c6f723d666237306139267374796c653d666c61742d737175617265)](https://laravel-livewire.com)

Laravel package for handling Select2 inputs for Livewire components.

Requirements
------------

[](#requirements)

- [PHP &gt;= 8.1](http://php.net/)
- [Laravel Framework &gt;= 10](https://github.com/laravel/framework)
- [Select2](https://select2.org)
- [jQuery](https://jquery.com/)
- [Livewire &gt;= 3](https://laravel-livewire.com)

Quick Installation
------------------

[](#quick-installation)

```
composer require josedaian/select2wire
```

For Livewire 2.x version, go here: [select2wire v1.x](https://github.com/josedaian/select2wire/tree/1.x)

Usage
-----

[](#usage)

Add the following line within your blade view, below the select2.js and jquery.js scripts

```
@select2wireScript
```

Within your Livewire component class, call the trait to do one of the functions when loading the component.

```
use Livewire\Component;
use JoseDaian\Select2\Traits\HasSelect2Wire;

class ExampleComponent extends Component
{
    use HasSelect2Wire;
}
```

If you don’t have a custom init event, you can call the `initSelect2` event directly within your component view.

```

    ...

```

Or in case you already have an init event inside your component, just add the following line

```
public function customInitFunction()
{
    // your code
    $this->initSelect2();
}
```

And within your blade view, you’ll need to add the `data-select2wire="select2"` attribute to your inputs select.

```

```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/josedaian/select2wire/blob/master/.github/CONTRIBUTING.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Jose Daian](https://github.com/josedaian)

Acknowledgments
---------------

[](#acknowledgments)

This package was inspired by [livewire-select2](https://github.com/Pharaonic/livewire-select2).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/josedaian/select2wire/LICENSE) for more information.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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 ~1 days

Total

7

Last Release

974d ago

Major Versions

v1.0.2 → v2.0.02023-11-01

1.x-dev → v2.0.12023-11-01

PHP version history (3 changes)v1.0.0PHP &gt;=7.2

v2.0.0PHP &gt;=8.0

v2.0.1PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c1a15f73e26bb4d3f6d05615421e0f0b56021f9631d1958f479428cf59d3f09?d=identicon)[josedaian](/maintainers/josedaian)

---

Top Contributors

[![josedaian](https://avatars.githubusercontent.com/u/20995948?v=4)](https://github.com/josedaian "josedaian (16 commits)")[![CloudTheWolf](https://avatars.githubusercontent.com/u/7809366?v=4)](https://github.com/CloudTheWolf "CloudTheWolf (4 commits)")

---

Tags

livewirelivewire-selectselect2 livewirelaravel select2

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/josedaian-select2wire/health.svg)

```
[![Health](https://phpackages.com/badges/josedaian-select2wire/health.svg)](https://phpackages.com/packages/josedaian-select2wire)
```

###  Alternatives

[livewire/flux

The official UI component library for Livewire.

9527.8M126](/packages/livewire-flux)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4216.5M111](/packages/livewire-volt)[masmerise/livewire-toaster

Beautiful toast notifications for Laravel / Livewire.

510630.3k7](/packages/masmerise-livewire-toaster)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21259.6k](/packages/ramonrietdijk-livewire-tables)[lakm/laravel-comments

Integrate seamless commenting functionality into your Laravel project.

40715.0k1](/packages/lakm-laravel-comments)[yajra/laravel-datatables-export

Laravel DataTables Queued Export Plugin.

362.2M4](/packages/yajra-laravel-datatables-export)

PHPackages © 2026

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