Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

liljohn's avatar

Laravel searching query

I am implementing search feature, I have a columnsearch_words in users table, where search_words populates when a new insertion is made to other(three) tables with space between keyword, Like

search_words
------------
john dotaChamp gammer
David English education 

Now the question is that how can i search all three tables on the basis of visitor search, Right now i am just querying only one table users. Like this :

$results = App\User::where('username','LIKE',"%$query%")->get();

0 likes
1 reply
martinbean's avatar

@liljohn You might want to look into an actual search service like ElasticSearch or Algolia.

Please or to participate in this conversation.