Query for searching word in column


#1

Hi

I need find all rows, where column ‘title’ contains for example word ‘android’.

this query doesn’t find anything

   .table('posts').where('title', 'android')

Because ‘title’ can be like “Android released version 9” etc, i.e. consist of few words.

How to build query for that? is it possible with lucid?


#2

Howdy,

You can use something like:

.table('posts').where('title', 'like', '%android%')

:slight_smile:


#3

thank you so much, works perfectly :slight_smile: