pharaonic/livewire-select2
| Install | |
|---|---|
composer require pharaonic/livewire-select2 |
|
| Latest Version: | 4.0.0 |
| PHP: | >=8.1 <8.6 |
| Laravel: | 10 – 13 |
| Older releases: | 7 · 8 · 9 |
| License: | MIT |
| Last Updated: | Oct 24, 2026 |
| Links: | GitHub · Packagist |
Select2 for Livewire components.
Two-way wire:model binding, dynamic and dependent selects, and templates, built on Livewire Assistant.
Installation
composer require pharaonic/livewire-select2
Load jQuery and Select2 as usual, then add the scripts once in your layout, before or after @livewireScripts:
@livewireScripts
@livewireSelect2Scripts
No Node build is needed. The 4.x line supports Livewire 4.3.4+ on Laravel 10.16+, 11, 12, and 13 with PHP 8.1 to 8.5.
Coming from 1.2? Run composer require pharaonic/livewire-select2:^4.0. Your markup keeps working; the documentation lists what changed.
Usage
<div wire:ignore>
<select data-pharaonic="select2" wire:model.live="country" data-placeholder="Choose a country" data-clear>
<option value=""></option>
<option value="1">Egypt</option>
<option value="2">Jordan</option>
</select>
</div>
The select follows country both ways: picking an option updates the component, and setting the property on the server updates the widget. Shorthands such as data-tags, data-clear, data-search-off, and data-parent cover common options; data-options takes any other Select2 option as JSON.
Documentation
Read the full Livewire Select2 documentation for options, dependent selects, templates, bundlers such as Vite, and upgrading from 1.2.
Support & Security
See SUPPORT.md and SECURITY.md.
License
MIT. See LICENSE.
Related Packages
A beautiful, searchable dropdown component for Laravel Livewire 3 & 4 applicatio...
A powerful async select component for Laravel Livewire with Alpine.js - a modern...
Shared Blade and JavaScript foundation that binds JavaScript widgets to Livewire...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 4.0.0 | >=8.1 <8.6 | ^10.16 || | MIT | |
| 3.0.0 | >=8.1 <8.6 | ^10.15 || | MIT | |
| 2.0.1 | >=8.0 <8.4 | ^7.30 || | MIT | |
| 2.0.0 | >=8.0 <8.4 | ^7.30 || | MIT | |
| 1.3.2 | >=7.4 <8.0 | ^7.30 || | MIT | |
| 1.3.1 | >=7.4 <8.0 | ^7.30 || | MIT | |
| 1.3.0 | >=7.4 <8.0 | ^7.30 || | MIT | |
| 1.2.0 | >=7.2 | MIT | ||
| 1.1.0 | >=7.2 | MIT | ||
| 1.0.5 | >=7.2 | MIT | ||
| 1.0.4 | >=7.2 | MIT | ||
| 1.0.3 | >=7.2 | MIT | ||
| 1.0.2 | >=7.2 | MIT | ||
| 1.0.1 | >=7.2 | MIT | ||
| 1.0.0 | >=7.2 | MIT |
