imsus
imsus
FFilament
Created by imsus on 8/27/2023 in #❓┊help
Has anyone successfully integrating admin panel with Laravel Scout yet?
These are the code I implement on Filament Resource Class:
public static function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('id')
->label('ID')
->searchable(), // make sure one table has searchable
])
->filters([
// ...
])
->actions([
// ...
])
->bulkActions([
// ...
])
->emptyStateActions([
// ...
])
->modifyQueryUsing(function (Builder $query) use ($table): Builder {
// This is where I implement the search function
return $query->whereIn('id', User::search($table->getQueryStringIdentifier('tableSearch'))->keys());
});
}
public static function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('id')
->label('ID')
->searchable(), // make sure one table has searchable
])
->filters([
// ...
])
->actions([
// ...
])
->bulkActions([
// ...
])
->emptyStateActions([
// ...
])
->modifyQueryUsing(function (Builder $query) use ($table): Builder {
// This is where I implement the search function
return $query->whereIn('id', User::search($table->getQueryStringIdentifier('tableSearch'))->keys());
});
}
My question, even though I doing these it still cannot find result. I found these on docs but this is for building table component not integrating with panel table. https://filamentphp.com/docs/3.x/tables/advanced#searching-records-with-laravel-scout
4 replies