nicolaslopezj / searchable

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

how to search if i have more than one word in one database field #150

Closed constantinosergiou closed 6 years ago

constantinosergiou commented 6 years ago

e.g company.name => testing test2 Company::search($query, null, false)->with(['City', 'Town', 'GlobalCategory', 'CompanyCertification']);

when i search testing it will show me the result correct if i search test2 it doesnt fetch ... when i do testing test2 it fetch ... how can i fix it ?

dwindev commented 6 years ago

hello @constantinosergiou try using this

Company::search("testing test2", null, true, true)->with(['City', 'Town', 'GlobalCategory', 'CompanyCertification']);

constantinosergiou commented 6 years ago

thanks