PHPackages                             drpshtiwan/livewire-async-select - 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. drpshtiwan/livewire-async-select

ActiveLibrary

drpshtiwan/livewire-async-select
================================

A powerful async select component for Laravel Livewire with Alpine.js - a modern alternative to Select2

3.2.0(3mo ago)1083.9k↓39.7%9MITPHPPHP &gt;=8.1CI passing

Since Nov 2Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/drpshtiwan/livewire-async-select)[ Packagist](https://packagist.org/packages/drpshtiwan/livewire-async-select)[ Docs](https://livewire-select.thejano.com)[ RSS](/packages/drpshtiwan-livewire-async-select/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (8)Versions (7)Used By (0)

Livewire Async Select
=====================

[](#livewire-async-select)

A powerful async select component for Laravel Livewire with Alpine.js - a modern, lightweight alternative to Select2.

[![Latest Version](https://camo.githubusercontent.com/8a0a51a9da1e5e68fd7556485587729df4345ac9f2dc8af956a27847d4a05c00/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6472707368746977616e2f6c697665776972652d6173796e632d73656c6563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drpshtiwan/livewire-async-select)[![GitHub Tests Action Status](https://camo.githubusercontent.com/bc2f6a369b11c87b123621eda14e2dbb5a0c7aabb4d9bf6991c8727d033176ed/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6472707368746977616e2f6c697665776972652d6173796e632d73656c6563742f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/drpshtiwan/livewire-async-select/actions?query=workflow%3Atests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/d896573f7109b23a7c8b24e1ba28741ca13f08f0b4ca36cf3486746c9d6f47cf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6472707368746977616e2f6c697665776972652d6173796e632d73656c6563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drpshtiwan/livewire-async-select)[![Code Style](https://camo.githubusercontent.com/3b3c737aea496c6e1d101e71596a571b3cb6f4e999ae19f620f7c7a1a211ba23/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d70696e742d6f72616e67653f7374796c653d666c61742d737175617265)](https://github.com/laravel/pint)[![License](https://camo.githubusercontent.com/54d61b2c268638450e726ad9eaeab86f28c32555f0b1c0231d2b0e6854177d70/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6472707368746977616e2f6c697665776972652d6173796e632d73656c6563743f7374796c653d666c61742d737175617265)](LICENSE)

🎥 Demo
------

[](#-demo)

[![Livewire Async Select Demo](assets/async-select.png)](https://www.youtube.com/watch?v=xwfKgZu49gg)

**[▶️ Watch Full Demo on YouTube](https://www.youtube.com/watch?v=xwfKgZu49gg)**

✨ Features
----------

[](#-features)

- 🚀 **Asynchronous Loading** - Load options dynamically from API endpoints
- 🔍 **Search &amp; Filter** - Built-in search with debouncing
- 🎯 **Multiple Selection** - Beautiful chip/tag display
- ⚡ **Alpine.js Powered** - Lightweight, no jQuery dependency
- 🎨 **Styled with Tailwind CSS** - Pre-built styles with `las-` prefix
- 🎭 **Custom Slots** - Fully customizable rendering
- 📦 **Easy Integration** - Native Livewire component
- 🔄 **Two-way Binding** - Full wire:model support
- 🔒 **No Style Conflicts** - All classes prefixed with `las-`
- 🔐 **Authentication Support** - Custom headers and internal authentication
- 🛡️ **Secure Internal Auth** - Signed tokens with replay protection

📚 Documentation
---------------

[](#-documentation)

**[📖 Full Documentation](https://livewire-select.thejano.com/)**

Complete guides, examples, and API reference available at:

### ****

[](#httpslivewire-selectthejanocom)

To build and view the documentation locally, see **[DOCS.md](DOCS.md)**.

⚡ Quick Install
---------------

[](#-quick-install)

1. **Install via Composer:**

```
composer require drpshtiwan/livewire-async-select
```

2. **Publish the CSS assets:**

```
php artisan vendor:publish --tag=async-select-assets
```

3. **Setup your layout (important!):**

```

    @asyncSelectStyles
    {{-- Optional: only if using Bootstrap 4 theme styling --}}
    {{-- @asyncSelectBootstrapV4Styles --}}
    @livewireStyles

    {{ $slot }}

    @livewireScripts
    @stack('scripts')  {{-- Required! --}}

```

> **⚠️ Important:** The `@stack('scripts')` directive is required for the component to work properly.

🎯 Basic Usage
-------------

[](#-basic-usage)

```

```

### Custom Slots (Livewire 3.3+ / 4.x)

[](#custom-slots-livewire-33--4x)

```

        {{ $option['label'] }}

        {{ $option['label'] }}

```

Slot variables are provided automatically:

- option slot: `$option`, `$isSelected`, `$isDisabled`, `$multiple`
- selected slot: `$option`

**API Route with async-auth middleware:**

```
// Default guard (web)
Route::middleware(['async-auth'])->get('/api/users/search', function (Request $request) {
    $users = User::where('name', 'like', "%{$request->get('search')}%")
        ->limit(20)
        ->get();

    return response()->json(['data' => $users]);
});

// With Sanctum
Route::middleware(['async-auth:sanctum'])->get('/api/users/search', function (Request $request) {
    // Works with Sanctum tokens or internal auth
    $users = User::where('name', 'like', "%{$request->get('search')}%")
        ->limit(20)
        ->get();

    return response()->json(['data' => $users]);
});

// With web guard and session persistence
Route::middleware(['web', 'async-auth:web,persist'])->get('/api/users/search', function (Request $request) {
    // Persists login in session
    $users = User::where('name', 'like', "%{$request->get('search')}%")
        ->limit(20)
        ->get();

    return response()->json(['data' => $users]);
});
```

The `async-auth` middleware is automatically registered and works exactly like `auth` middleware, but also handles internal authentication automatically when the `X-Internal-User` header is present. Supports all guards: `async-auth:web`, `async-auth:sanctum`, `async-auth:api`, etc.

**[→ View full documentation](https://livewire-select.thejano.com/)**

📋 Requirements
--------------

[](#-requirements)

- PHP 8.1+
- Laravel 10.x, 11.x, or 12.x
- Livewire 3.3+ or 4.x

🆚 Why This Package?
-------------------

[](#-why-this-package)

FeatureLivewire Async SelectSelect2jQuery Dependency❌ No✅ YesLivewire Integration✅ Native⚠️ ManualBundle Size🟢 Small🟡 LargeModern Stack✅ Yes❌ Legacy🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please see the [documentation](https://drpshtiwan.github.io/livewire-async-select/) for details.

📄 License
---------

[](#-license)

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

🙏 Credits
---------

[](#-credits)

- [Dr. Pshtiwan Mahmood](https://github.com/drpshtiwan)
- [All Contributors](https://github.com/drpshtiwan/livewire-async-select/contributors)

🔗 Links
-------

[](#-links)

- **[📚 Documentation](https://livewire-select.thejano.com/)**
- **[📦 Packagist](https://packagist.org/packages/drpshtiwan/livewire-async-select)**
- **[🐛 Issues](https://github.com/drpshtiwan/livewire-async-select/issues)**
- **[💬 Discussions](https://github.com/drpshtiwan/livewire-async-select/discussions)**

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance82

Actively maintained with recent releases

Popularity39

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.5% 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 ~20 days

Total

6

Last Release

94d ago

Major Versions

1.1.0 → 2.0.02025-11-13

2.0.0 → 3.0.02026-02-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3bae4eda28dfbd2e4a288a22c49c4a93c504c7b483e8d8353d7fea1eabcd921?d=identicon)[drpshtiwan](/maintainers/drpshtiwan)

---

Top Contributors

[![drpshtiwan](https://avatars.githubusercontent.com/u/6718949?v=4)](https://github.com/drpshtiwan "drpshtiwan (42 commits)")[![gjm](https://avatars.githubusercontent.com/u/77360?v=4)](https://github.com/gjm "gjm (1 commits)")[![sergebenard](https://avatars.githubusercontent.com/u/18753991?v=4)](https://github.com/sergebenard "sergebenard (1 commits)")

---

Tags

laravelautocompletelivewiredropdownselectselect2alpinealpinejsasync-selectajax-select

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/drpshtiwan-livewire-async-select/health.svg)

```
[![Health](https://phpackages.com/badges/drpshtiwan-livewire-async-select/health.svg)](https://phpackages.com/packages/drpshtiwan-livewire-async-select)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[laravel-frontend-presets/tall

TALL preset for Laravel.

2.6k692.9k1](/packages/laravel-frontend-presets-tall)[robsontenorio/mary

Gorgeous UI components for Livewire powered by daisyUI and Tailwind

1.5k454.7k15](/packages/robsontenorio-mary)[victorybiz/laravel-simple-select

Laravel Simple Select inputs component for Blade and Livewire.

13721.1k](/packages/victorybiz-laravel-simple-select)[tanthammar/livewire-window-size

Laravel blade directives and php helpers for serverside rendered content, based on browser window size WITHOUT css. Requires Livewire and AlpineJS

2321.0k](/packages/tanthammar-livewire-window-size)

PHPackages © 2026

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