nicolaslopezj / searchable

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

Possible to rename relevance column alias #189

Closed arthurlauck closed 5 years ago

arthurlauck commented 5 years ago

Hey there,

I had an issue, that I had already a column in database called 'relevance', so It would duplicate, Column already exists: 1060 Duplicate column name 'relevance'.

To avoid this, I pulled out the possibility to rename the alias, in the class that is using the Trait, so you could just set the property like this: protected $relevanceField = 'ratio';