I have a parent resource. lets say team and inside team resouce detail page i am showing other rosources for example audience resouce by using following code.
HasMany::make('Audiences')
Now this audience resource is visible with a search bar inside team resouce detail page. But when i try to search anything on the search bar. It's searching all the data inside Audience table instead it should search for those audiences which are connected to this team.
Any help would great. Thank you.
After a lots of hit and try. I finally able to fix this issue. The issue was caused by Laravel Scout. I have been using Searchable trait on my model. That's what causing the issue.
And i cannot remove this trait as well because i need scout functionality as well. So to fix this i have added the following function inside the Resource file and it worked.
public static function usesScout()
{
return false;
}