nicolaslopezj / searchable

A php trait to search laravel models
MIT License
2.01k stars 291 forks source link

Multitable search #105

Open mehrdad-shokri opened 8 years ago

mehrdad-shokri commented 8 years ago

Sorry for creating new issue but this question seems has not been asked before. How can I search several models based on their relationships?
Let me describe: I have 3 models venues,locations,cuisines. a Venue has one Location and a location Belongs to a venue. a venue has many cuisines and a cuisine belongs to many venues. So what I want to do is call Venue::search() and it searches for: venue.name , location.address, cuisine.name in other words it searches related models in columns I specify. Is that possible? tnx.

mreduar commented 4 years ago

Any response to this? I'm also interested in doing exactly this.

mehrdad-shokri commented 4 years ago

I decided to move my search to Laravel Scout. You can check how to search through models here