Skip to content

Select Filter with Custom FK #8397

Answered by leandrocfe
chaseconey asked this question in Help
Discussion options

You must be logged in to vote
->filters([
    SelectFilter::make('sender')
        ->relationship('slackUser', 'name')
        ->query(
            fn (array $data, Builder $query): Builder =>
            $query->when(
                $data['value'],
                fn (Builder $query, $value): Builder => $query->whereSender($data['value'])
            )
        )
])

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@chaseconey
Comment options

@leandrocfe
Comment options

@chaseconey
Comment options

@leandrocfe
Comment options

Answer selected by chaseconey
@chaseconey
Comment options

@leandrocfe
Comment options

@ajayjoshioutdosolutions
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants