Skip to content

How to filter NOT IN value? #629

Answered by mitchierichie
C-Collamar asked this question in Q&A
Discussion options

You must be logged in to vote

@C-Collamar what you want is either a custom or callback filter.

See https://spatie.be/docs/laravel-query-builder/v3/features/filtering#callback-filters , custom filters is the next section below that. You would want to define something like a filter called user_id_not_in and then handle the query logic yourself. It's not as easy as a built-in solution but it's not super difficult either, and it works.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by C-Collamar
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