How to make my SQL query search several words in the sentence even if they do not follow each other

Viewed 406

I have a SQL query for my search form.

$term = $request->get('term');

$queries = Article::where('title', 'LIKE', '%' . $term . '%')->published()->get();

My research is working. If I have an article called "my great article is awesome" and that I write in my search form "greate article" it works.

But if I write "article awesome", the words do not follow each other, and it does not work.

How do I get my query to work just with keywords?

Thank you

3 Answers
Related