0

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.

3
  • have you changed the index query on the Audiences nova resource? Commented Dec 5, 2023 at 16:17
  • yes i have tried but it didn't work. Commented Dec 9, 2023 at 16:24
  • my guess since you have shared no information, is that somewhere you are applying an OR condition without wrapping it like: where ... AND (... OR ...) Commented Dec 11, 2023 at 8:47

1 Answer 1

0

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;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.