sertxudeveloper/livewire-combobox
A Livewire combobox component for Laravel that turns a standard select into a searchable, keyboard-friendly dropdown. Drop it into Blade views for a lightweight, reactive picker backed by Livewire, with filtering handled client-side and no extra JavaScript build step required.
composer require sertxudeveloper/livewire-combobox
composer show sertxudeveloper/livewire-combobox
src/ for the Livewire component class and any public methods/properties exposed to your app.php artisan vendor:publish
Then publish the package’s views/config using the tags shown, for example:
php artisan vendor:publish --tag=livewire-combobox-views
php artisan vendor:publish --tag=livewire-combobox-config
public function getUsersProperty(): array
{
return User::query()
->orderBy('name')
->limit(50)
->get()
->map(fn (User $user) => [
'value' => $user->id,
'label' => $user->name,
])
->all();
}
<livewire:combobox
wire:model="userId"
:options="$this->users"
/>
Use the component/prop names documented by the package if they differ.wire:model and validate the selected value like any other Livewire property:
protected $rules = [
'userId' => ['required', 'exists:users,id'],
];
public function updatedCountryId(): void
{
$this->cityId = null;
}
Re-render the child combobox with a stable wire:key when its option set changes.value/label array to the combobox. Use wire:model.live.debounce.300ms where immediate updates are needed.wire:key usage.Livewire::test(MyForm::class)
->set('userId', $user->id)
->assertSet('userId', $user->id);
php artisan vendor:publish --force
php artisan view:clear
vendor/ may be purged. Add the package’s published views to your tailwind.config.js content array, or safelist the relevant classes.wire:model to deferred. For dependent fields or search-as-you-type, use .live deliberately and add debouncing for server-side queries.wire:key on the combobox and on repeated option elements to avoid stale labels or selection state.value and label, and limit results.php artisan view:clear and php artisan config:clear.Livewire::test() to isolate whether the issue is server-side state or front-end behavior.How can I help you explore Laravel packages today?