nicolaslopezj / searchable

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

Duplicate Datas #92

Open vireefdev opened 8 years ago

vireefdev commented 8 years ago

Im doing some joins. And when i search a common word, it tends to duplicate my display.

For example.

I have tags and genre. I have "Rock" tag in tags table and "Rock" genre in genre table. When i search "Rock", it displays the users, it duplicates my result.

vishalinfyom commented 5 years ago

@vireefdev you just need to add into protected $searchable = []

protected $searchable = [
        'groupBy'=>['table.id'],
];