Skip to content

I have custom page, I want to add a table and tabs as filters, but the tabs seems to not work when selected #12490

Answered by RejownAhmed
RejownAhmed asked this question in Help
Discussion options

You must be logged in to vote

I forgot but I found the solution, see this function:

->modifyQueryUsing(function (Builder $q) {
                    info('i', [
                        'query' => $q->get()
                    ]);
                    return $q->where('id', 6);
                    //$q->whereHas('students', fn($q)=> $q->id === auth()->id()
                })

Here the callback parameter Builder $q should be Builder $query

It seems that Filamentphp passes the parameter as named parameter. That's why the we must use $query in it's full form. We cannot use any other name at all.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@uksitebuilder
Comment options

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