Skip to content

Filter get all data from DB instead of unique values #1497

Answered by marineusde
jigapate asked this question in Q&A
Discussion options

You must be logged in to vote

cause it filters the "no needed values". example:

second_table got the entrys "one", "two" and "three"
first_table just got connections to "one" and "two", "three" is not used

In my excample, the user cant filter with "three", cause he dont got a result.

But if you dont need it, maybe this helps:

    public function filters(): array
    {
        return [
            Filter::select('name', 'name')
                ->dataSource(LiveFuture::select('asset_symbol')->distinct()->orderBy('asset_symbol')->get())
                ->optionValue('name')
                ->optionLabel('name')
        ];
    }

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jigapate
Comment options

@marineusde
Comment options

Answer selected by jigapate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants