Filter for unique values is not working

Hi there! I tried to create a filter for a table, and it didn't work:
Filter::make('is_unique')
->label('Unique')
->query(
fn (Builder $query): Builder => $query->select()->groupBy('phone')
)
Filter::make('is_unique')
->label('Unique')
->query(
fn (Builder $query): Builder => $query->select()->groupBy('phone')
)
2 Replies
awcodes
awcodes17mo ago
You’re not actually selecting anything.
Alex Manase
Alex ManaseOP17mo ago
I select all columns because the default for select() is [*]

Did you find this page helpful?