© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
5 replies
mostafa-amine

Issue when working with searchable method in Select component

Please make sure you see the video.

The issue is when i work with searchable method in Select component it shows a random number sometimes 8 and sometimes 21 , but when i remove searchable method it just works fine

Here is the filament code:
Select::make('theme_id')
    ->prefixIcon('heroicon-o-tag')
    ->label('Themes')
    ->options(Category::parentCategories()->pluck('name', 'id'))
    ->searchable()
    ->live(),

Select::make('category_id')
    ->required()
    ->searchable()
    ->prefixIcon('heroicon-o-rectangle-stack')
    ->label('Categories')
    ->options(function (Get $get) {
        return Category::childCategories($get('theme_id'))->pluck('name', 'id');
    })
Select::make('theme_id')
    ->prefixIcon('heroicon-o-tag')
    ->label('Themes')
    ->options(Category::parentCategories()->pluck('name', 'id'))
    ->searchable()
    ->live(),

Select::make('category_id')
    ->required()
    ->searchable()
    ->prefixIcon('heroicon-o-rectangle-stack')
    ->label('Categories')
    ->options(function (Get $get) {
        return Category::childCategories($get('theme_id'))->pluck('name', 'id');
    })



Here is the code for the
childCategories
childCategories
scope:

public function scopeChildCategories($query, int $theme_id = null)
{
    return $theme_id ? $query->where('parent_id', $theme_id) : $query->whereNotNull('parent_id');
}
public function scopeChildCategories($query, int $theme_id = null)
{
    return $theme_id ? $query->where('parent_id', $theme_id) : $query->whereNotNull('parent_id');
}
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Issue With Searchable Select
FilamentFFilament / ❓┊help
2y ago
Select component with searchable & live?
FilamentFFilament / ❓┊help
3y ago
Default value with searchable in select component
FilamentFFilament / ❓┊help
3y ago
Select Blade Component - Searchable
FilamentFFilament / ❓┊help
2y ago