The title says it all.
I get that I can do this :
DB:table('items')->where('something', 'value')->get()
But what I want to check the where condition for multiple values like so:
DB:table('items')->where('something', 'array_of_value')->get()
Is there an easy way of doing this?
There's
whereIn()
:You can use
whereIn
which accepts an array as second paramter.You can chain where multiple times.
This will use
AND
operator. if you needOR
you can useorWhere
method.For advanced
where
statementsIf you need by several params:
You could use one of the below solutions:
or: