defstudio/filament-searchable-input
remember() or Redis) to avoid N+1 queries.TextInput, Select, or TagsInput components.filament/filament:^4.x → use defstudio/filament-searchable-input:^4.x).composer require defstudio/filament-searchable-input
Publish config/assets if customization is needed:
php artisan vendor:publish --tag="filament-searchable-input-config"
use Defstudio\FilamentSearchableInput\Forms\Components\SearchableInput;
SearchableInput::make('user_id')
->searchableUsing(User::query())
->label('Select User')
->required(),
searchableUsing() for complex filters.->remote() with a custom endpoint:
->remote()
->url(fn ($query) => route('api.users.search', ['q' => $query]))
->searchField('query')
->optionsHandler(fn (string $query) => User::where('name', 'like', "%{$query}%")->get())
filament-spatie-laravel-medialibrary). Test thoroughly.->optionsHandler(fn ($query) => User::where(...)->paginate(20))
Laravel Debugbar).->logQueries() to inspect search queries.logs/filament.log for errors.->with() or ->load() in Eloquent.->fuzzy() or ->similar() (if supported).->emptyState() for UX.| Scenario | Impact | Mitigation |
|---|---|---|
| API Endpoint Down | Broken search | Fallback to local cache or error UI |
| Database Timeout | Slow responses | Implement retry logic |
| Large Dataset | UI freezes | Add pagination/loading states |
| CSS/JS Conflicts | Rendering issues | Isolate styles with !important or shadow DOM |
How can I help you explore Laravel packages today?