Select Filter with relation

When I've a lot of data in users table and I'm applying filter on other page then the page is not working. I've used this code.
SelectFilter::make('author')->relationship('user', 'name')
->query(function (Builder $query, array $data): Builder {
return $query
->when(
$data['value'],
fn (Builder $query, $userid): Builder => $query->where('user_id',$userid),
);
}),
SelectFilter::make('author')->relationship('user', 'name')
->query(function (Builder $query, array $data): Builder {
return $query
->when(
$data['value'],
fn (Builder $query, $userid): Builder => $query->where('user_id',$userid),
);
}),
1 Reply
Patrick Boivin
Patrick Boivin16mo ago
What is not working on the page? Can you describe the issue?
Want results from more Discord servers?
Add your server