PHPackages                             fabioguin/livewire-searchable-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. [Caching](/categories/caching)
4. /
5. fabioguin/livewire-searchable-select

ActiveLibrary[Caching](/categories/caching)

fabioguin/livewire-searchable-select
====================================

High-performance Livewire component for searchable select inputs with relevance-based ordering, caching, and optimized UX

2.0.1(7mo ago)1122MITPHPPHP ^8.1|^8.2CI failing

Since Jul 2Pushed 7mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (5)Versions (19)Used By (0)

Livewire Searchable Select
==========================

[](#livewire-searchable-select)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d0e497b837c36acdbc70f5bfd3f263353ffbbb423341d0935a821af417298090/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666162696f6775696e2f6c697665776972652d73656172636861626c652d73656c6563742e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/fabioguin/livewire-searchable-select)[![Total Downloads](https://camo.githubusercontent.com/48dd9d679dc4fdc6ce8d3f22c534a099f14b40ecdffba9d9d4ee2b4df81d80e2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666162696f6775696e2f6c697665776972652d73656172636861626c652d73656c6563742e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/fabioguin/livewire-searchable-select)[![GitHub license](https://camo.githubusercontent.com/d6f27c10215372463e50443468c7f83dec456b1eeede10c157a794017af8c401/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f666162696f6775696e2f6c697665776972652d73656172636861626c652d73656c6563743f7374796c653d666f722d7468652d6261646765)](https://github.com/fabioguin/livewire-searchable-select/blob/master/LICENSE)

High-performance Livewire component for searchable select inputs with relevance-based ordering, intelligent caching, and optimized UX.

Features
--------

[](#features)

- **High Performance**: Optimized database queries with intelligent caching
- **Relevance-Based Ordering**: Smart search results ranked by relevance
- **Debounced Input**: Smooth UX with 300ms debouncing to reduce server load
- **Redis Caching**: Automatic caching of search results for better performance
- **SQL Injection Protection**: Secure input sanitization and validation
- **Responsive Design**: Works perfectly on all device sizes
- **Customizable**: Easy to customize with CSS classes and configuration
- **Model Scopes**: Support for complex model filtering with scopes
- **Multi-language**: Built-in internationalization support

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

[](#requirements)

- [Laravel 10 or 11](https://laravel.com/docs/10.x)
- [Livewire 3.0+](https://livewire.laravel.com/)
- [Alpine JS](https://alpinejs.dev/) (included with Livewire)
- [Redis](https://redis.io/) (optional, for caching)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require fabioguin/livewire-searchable-select
```

### Redis Configuration (Optional but Recommended)

[](#redis-configuration-optional-but-recommended)

For optimal performance, configure Redis as your cache driver:

```
# In your .env file
CACHE_DRIVER=redis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
```

The package will automatically use Redis for caching search results, significantly improving performance.

Basic Usage
-----------

[](#basic-usage)

- use trait `SearchableSelect` in your livewire component:

```
