prvious / filament-combobox
Combobox for Filament Panel
Fund package maintenance!
prvious
Installs: 68
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
Language:JavaScript
pkg:composer/prvious/filament-combobox
Requires
- php: ^8.2
- filament/forms: ^4.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- laravel/pint: ^1.25
- nunomaduro/collision: ^8.8.2
- orchestra/testbench: ^9.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
This package is auto-updated.
Last update: 2025-10-22 18:51:41 UTC
README
Description bla bla bla ...
Installation
You can install the package via composer:
composer require prvious/filament-combobox
Optionally, you can publish the views using
php artisan vendor:publish --tag="filament-combobox-views"
This is the contents of the published config file:
return [
];
Usage
Basic Usage
use Prvious\Filament\Combobox\Components\Combobox; Combobox::make('status') ->options([ 'draft' => 'Draft', 'published' => 'Published', 'archived' => 'Archived', ])
Setting a Search Query
You can set a search query that will be displayed in the search input when the component loads:
Combobox::make('product') ->searchable() ->options([ // your options ]) ->searchQuery('electronics')
This will populate the search input with "electronics" but will not trigger a search automatically.
Auto-Triggering a Search on Load
If you want to perform a search automatically when the component boots, use the autoSearch() method along with searchQuery():
Combobox::make('product') ->searchable() ->getSearchResultsUsing(function (string $search) { return Product::where('name', 'like', "%{$search}%") ->limit(50) ->pluck('name', 'id') ->toArray(); }) ->searchQuery('electronics') ->autoSearch()
This is useful when you want to pre-filter options based on context, such as:
- Showing products from a specific category
- Filtering items based on user permissions
- Displaying search results based on a related field value
You can also conditionally enable auto-search:
Combobox::make('product') ->searchable() ->searchQuery($categoryName) ->autoSearch(filled($categoryName))
Note: The autoSearch() method requires that the component is searchable and has a search handler configured.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.